forked from
tangled.org/core
Monorepo for Tangled
1package types
2
3import (
4 "github.com/go-git/go-git/v5/plumbing/object"
5)
6
7type RepoIndexResponse struct {
8 IsEmpty bool `json:"is_empty"`
9 Ref string `json:"ref,omitempty"`
10 Readme string `json:"readme,omitempty"`
11 ReadmeFileName string `json:"readme_file_name,omitempty"`
12 Commits []*object.Commit `json:"commits,omitempty"`
13 Description string `json:"description,omitempty"`
14 Files []NiceTree `json:"files,omitempty"`
15 Branches []Branch `json:"branches,omitempty"`
16 Tags []*TagReference `json:"tags,omitempty"`
17 TotalCommits int `json:"total_commits,omitempty"`
18}
19
20type RepoLogResponse struct {
21 Commits []*object.Commit `json:"commits,omitempty"`
22 Ref string `json:"ref,omitempty"`
23 Description string `json:"description,omitempty"`
24 Log bool `json:"log,omitempty"`
25 Total int `json:"total,omitempty"`
26 Page int `json:"page,omitempty"`
27 PerPage int `json:"per_page,omitempty"`
28}
29
30type RepoCommitResponse struct {
31 Ref string `json:"ref,omitempty"`
32 Diff *NiceDiff `json:"diff,omitempty"`
33}
34
35type RepoDiffTreeResponse struct {
36 DiffTree *DiffTree `json:"difftree,omitempty"`
37}
38
39type RepoTreeResponse struct {
40 Ref string `json:"ref,omitempty"`
41 Parent string `json:"parent,omitempty"`
42 Description string `json:"description,omitempty"`
43 DotDot string `json:"dotdot,omitempty"`
44 Files []NiceTree `json:"files,omitempty"`
45}
46
47type TagReference struct {
48 Reference `json:"ref,omitempty"`
49 Tag *object.Tag `json:"tag,omitempty"`
50 Message string `json:"message,omitempty"`
51}
52
53type Reference struct {
54 Name string `json:"name"`
55 Hash string `json:"hash"`
56}
57
58type Branch struct {
59 Reference `json:"reference"`
60}
61
62type RepoTagsResponse struct {
63 Tags []*TagReference `json:"tags,omitempty"`
64}
65
66type RepoBranchesResponse struct {
67 Branches []Branch `json:"branches,omitempty"`
68}
69
70type RepoBranchResponse struct {
71 Branch Branch `json:"branch,omitempty"`
72}
73
74type RepoDefaultBranchResponse struct {
75 Branch string `json:"branch,omitempty"`
76}
77
78type RepoBlobResponse struct {
79 Contents string `json:"contents,omitempty"`
80 Ref string `json:"ref,omitempty"`
81 Path string `json:"path,omitempty"`
82 IsBinary bool `json:"is_binary,omitempty"`
83
84 Lines int `json:"lines,omitempty"`
85 SizeHint uint64 `json:"size_hint,omitempty"`
86}