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

ambee/giterated

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

Connection

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨415ff8d

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