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

ambee/giterated

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

Add more backend logic

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨5060ca2

⁨src/backend/git.rs⁩ - ⁨1748⁩ bytes
Raw
1 use std::error::Error;
2
3 use crate::{
4 messages::repository::{
5 CreateRepositoryRequest, CreateRepositoryResponse, RepositoryFileInspectRequest,
6 RepositoryFileInspectionResponse, RepositoryInfoRequest, RepositoryIssueLabelsRequest,
7 RepositoryIssueLabelsResponse, RepositoryIssuesCountRequest, RepositoryIssuesCountResponse,
8 RepositoryIssuesRequest, RepositoryIssuesResponse,
9 },
10 model::repository::RepositoryView,
11 };
12
13 use super::{IssuesBackend, 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: &CreateRepositoryRequest,
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: &RepositoryFileInspectRequest,
41 ) -> Result<RepositoryFileInspectionResponse, Box<dyn Error + Send>> {
42 todo!()
43 }
44 }
45
46 impl IssuesBackend for GitBackend {
47 fn issues_count(
48 &mut self,
49 request: &RepositoryIssuesCountRequest,
50 ) -> Result<RepositoryIssuesCountResponse, Box<dyn Error + Send>> {
51 todo!()
52 }
53
54 fn issue_labels(
55 &mut self,
56 request: &RepositoryIssueLabelsRequest,
57 ) -> Result<RepositoryIssueLabelsResponse, Box<dyn Error + Send>> {
58 todo!()
59 }
60
61 fn issues(
62 &mut self,
63 request: &RepositoryIssuesRequest,
64 ) -> Result<RepositoryIssuesResponse, Box<dyn Error + Send>> {
65 todo!()
66 }
67 }
68