Skip to content
Clone

feat(export): add repo git_ref export

zhenyi committed
parent 73dfac5 commit d5d3b70 Browse files

1 file changed

+59 −0

Added lib/export/repo/git_ref.rs View lib/export/repo/git_ref.rs
@@ -0,0 +1,59 @@
1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
5pub struct GitRef {
6 pub name: String,
7 pub sha: String,
8 pub type_: String,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
12pub struct CommitView {
13 pub sha: String,
14 pub message: String,
15 pub author_name: Option<String>,
16 pub author_email: Option<String>,
17 pub committer_name: Option<String>,
18 pub committer_email: Option<String>,
19 pub parent_shas: Vec<String>,
20 pub tree_sha: String,
21 pub authored_at: Option<String>,
22 pub committed_at: Option<String>,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
26pub struct CommitDiffPayload {
27 pub sha: String,
28 pub format: String,
29 pub content: String,
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
33pub struct TreeView {
34 pub sha: String,
35 pub entries: Vec<TreeEntryView>,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
39pub struct TreeEntryView {
40 pub path: String,
41 pub mode: String,
42 pub type_: String,
43 pub sha: String,
44 pub size: Option<i64>,
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
48pub struct BlobView {
49 pub sha: String,
50 pub size: i64,
51 pub encoding: String,
52 pub content: String,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
56pub struct NoteView {
57 pub sha: String,
58 pub message: String,
59}