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

ambee/giterated

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

Fixes

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨8a111d7

⁨src/model/repository.rs⁩ - ⁨893⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 use super::instance::Instance;
4
5 #[derive(Hash, Clone, Serialize, Deserialize)]
6 pub struct Repository {
7 pub name: String,
8 pub instance: Instance,
9 }
10
11 #[derive(Clone, Debug, Serialize, Deserialize)]
12 pub struct RepositoryView {
13 pub name: String,
14 pub description: String,
15 pub default_branch: String,
16 pub latest_commit: CommitMetadata,
17 pub files: Vec<RepositoryFile>,
18 }
19
20 #[derive(Debug, Clone, Serialize, Deserialize)]
21 pub enum RepositoryFile {
22 Directory(String),
23 File(String),
24 }
25
26 #[derive(Debug, Clone, Serialize, Deserialize)]
27 pub struct RepositoryFileWithCommitMetadata {
28 pub file: RepositoryFile,
29 pub commit_metadata: CommitMetadata,
30 }
31
32 #[derive(Debug, Clone, Serialize, Deserialize, Default)]
33 pub struct CommitMetadata {
34 pub author: String,
35 pub message: String,
36 pub hash: String,
37 pub time: (),
38 }
39