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