Monorepo for Tangled
at enable-html 92 lines 2.9 kB view raw
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 Commit *object.Commit `json:"commit,omitempty"` 65 IsDefault bool `json:"is_deafult,omitempty"` 66} 67 68type RepoTagsResponse struct { 69 Tags []*TagReference `json:"tags,omitempty"` 70} 71 72type RepoBranchesResponse struct { 73 Branches []Branch `json:"branches,omitempty"` 74} 75 76type RepoBranchResponse struct { 77 Branch Branch `json:"branch,omitempty"` 78} 79 80type RepoDefaultBranchResponse struct { 81 Branch string `json:"branch,omitempty"` 82} 83 84type RepoBlobResponse struct { 85 Contents string `json:"contents,omitempty"` 86 Ref string `json:"ref,omitempty"` 87 Path string `json:"path,omitempty"` 88 IsBinary bool `json:"is_binary,omitempty"` 89 90 Lines int `json:"lines,omitempty"` 91 SizeHint uint64 `json:"size_hint,omitempty"` 92}