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 RepoTreeResponse struct {
36 Ref string `json:"ref,omitempty"`
37 Parent string `json:"parent,omitempty"`
38 Description string `json:"description,omitempty"`
39 DotDot string `json:"dotdot,omitempty"`
40 Files []NiceTree `json:"files,omitempty"`
41}
42
43type TagReference struct {
44 Reference `json:"ref,omitempty"`
45 Tag *object.Tag `json:"tag,omitempty"`
46 Message string `json:"message,omitempty"`
47}
48
49type Reference struct {
50 Name string `json:"name"`
51 Hash string `json:"hash"`
52}
53
54type Branch struct {
55 Reference `json:"reference"`
56}
57
58type RepoTagsResponse struct {
59 Tags []*TagReference `json:"tags,omitempty"`
60}
61
62type RepoBranchesResponse struct {
63 Branches []Branch `json:"branches,omitempty"`
64}
65
66type RepoBlobResponse struct {
67 Contents string `json:"contents,omitempty"`
68 Ref string `json:"ref,omitempty"`
69 Path string `json:"path,omitempty"`
70 IsBinary bool `json:"is_binary,omitempty"`
71
72 Lines int `json:"lines,omitempty"`
73 SizeHint uint64 `json:"size_hint,omitempty"`
74}