JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Add backend trait and git backend stub

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨b9203a9

⁨src/backend/git.rs⁩ - ⁨1731⁩ bytes
Raw
1 use std::error::Error;
2
3 use crate::{
4 command::repository::{
5 CreateRepositoryCommand, CreateRepositoryResponse, RepositoryFileInspectionCommand,
6 RepositoryFileInspectionResponse, RepositoryInfoRequest, RepositoryIssueLabelsRequest,
7 RepositoryIssueLabelsResponse, RepositoryIssuesCountRequest, RepositoryIssuesCountResponse,
8 RepositoryIssuesRequest, RepositoryIssuesResponse,
9 },
10 model::repository::RepositoryView,
11 };
12
13 use super::RepositoryBackend;
14
15 pub struct GitBackend;
16
17 impl GitBackend {
18 pub fn new() -> Self {
19 Self
20 }
21 }
22
23 impl RepositoryBackend for GitBackend {
24 fn create_repository(
25 &mut self,
26 request: &CreateRepositoryCommand,
27 ) -> Result<CreateRepositoryResponse, Box<dyn Error + Send>> {
28 todo!()
29 }
30
31 fn repository_info(
32 &mut self,
33 request: &RepositoryInfoRequest,
34 ) -> Result<RepositoryView, Box<dyn Error + Send>> {
35 todo!()
36 }
37
38 fn repository_file_inspect(
39 &mut self,
40 request: &RepositoryFileInspectionCommand,
41 ) -> Result<RepositoryFileInspectionResponse, Box<dyn Error + Send>> {
42 todo!()
43 }
44
45 fn repository_issues_count(
46 &mut self,
47 request: &RepositoryIssuesCountRequest,
48 ) -> Result<RepositoryIssuesCountResponse, Box<dyn Error + Send>> {
49 todo!()
50 }
51
52 fn repository_issue_labels(
53 &mut self,
54 request: &RepositoryIssueLabelsRequest,
55 ) -> Result<RepositoryIssueLabelsResponse, Box<dyn Error + Send>> {
56 todo!()
57 }
58
59 fn repository_issues(
60 &mut self,
61 request: &RepositoryIssuesRequest,
62 ) -> Result<RepositoryIssuesResponse, Box<dyn Error + Send>> {
63 todo!()
64 }
65 }
66