Documentation ¶
Index ¶
- Constants
- func FindGitDir() (string, error)
- func GenerateRepoNickName(directory, remote string) string
- type Account
- type Approvals
- type Comment
- type CommentContext
- type CommentThread
- type Commit
- type CommitMetadata
- type Diff
- type DiffLineLocation
- type MergeReq
- func (mreq *MergeReq) Activity() string
- func (mreq *MergeReq) Age() string
- func (mreq *MergeReq) Equal(othermreq *MergeReq) bool
- func (mreq *MergeReq) LocalBranch(version int) string
- func (mreq *MergeReq) OriginRef() string
- func (mreq *MergeReq) ReviewURL() string
- func (mreq *MergeReq) SourceURL() string
- func (mreq *MergeReq) String() string
- func (mreq *MergeReq) ThreadIndexFromID(id string) (int, error)
- func (mreq *MergeReq) ToJSON() ([]byte, error)
- type MergeReqFilter
- type MergeReqList
- type MergeReqMetadata
- type MergeReqSorter
- type MergeReqState
- type MergeReqStatus
- type Repo
- type RepoState
- type Report
- type Reports
- type Repos
- type Series
- type SeriesMetadata
- type User
Constants ¶
View Source
const ( RepoStateActive = RepoState("active") RepoStateInactive = RepoState("inactive") RepoStateHidden = RepoState("hidden") )
Variables ¶
This section is empty.
Functions ¶
func FindGitDir ¶
func GenerateRepoNickName ¶
Types ¶
type Comment ¶
type Comment struct { Author User `json:"author"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedt"` Description string `json:"description"` System bool `json:"system"` Resolvable bool `json:"resolvable"` Resolved bool `json:"resolved"` Resolver *Account `json:"resolver"` Context *CommentContext `json:"context"` }
type CommentContext ¶
type CommentContext struct { BaseHash string `json:"baseHash"` StartHash string `json:"startHash"` HeadHash string `json:"headHash"` NewFile string `json:"newFile"` NewLine uint `json:"newLine"` OldFile string `json:"oldFile"` OldLine uint `json:"oldLine"` }
func (*CommentContext) Rebase ¶
func (ctx *CommentContext) Rebase(target *Commit, series *Series) *CommentContext
func (*CommentContext) String ¶
func (ctx *CommentContext) String() string
type CommentThread ¶
type Commit ¶
type Commit struct { Hash string `json:"hash"` Title string `json:"title"` Author User `json:"author"` Committer User `json:"committer"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Message string `json:"message"` Diffs []Diff `json:"diffs"` Metadata CommitMetadata `json:"bichonMetadata"` }
type CommitMetadata ¶
type CommitMetadata struct {
Partial bool `json:"partial"`
}
type Diff ¶
type Diff struct { Content string `json:"content"` NewFile string `json:"newFile"` OldFile string `json:"oldFile"` NewMode string `json:"newMode"` OldMode string `json:"oldMode"` CreatedFile bool `json:"createdFile"` RenamedFile bool `json:"renamedFile"` DeletedFile bool `json:"deletedFile"` }
func (*Diff) Apply ¶
func (diff *Diff) Apply(line uint) (DiffLineLocation, uint, error)
If @line is not present in diff, return (false, updated line) If @line is context in diff, return (false, updated line) If @line is deleted in diff, return (true, unchanged line) @line cannot be added in diff
func (*Diff) IsBinarySummary ¶
func (*Diff) Revert ¶
func (diff *Diff) Revert(line uint) (DiffLineLocation, uint, error)
If @line is not present in diff, return (OUTSIDE, updated line) If @line is context in diff, return (CONTEXT, updated line) If @line is added in diff, return (ADDED, unchanged line) @line cannot be deleted in diff
type DiffLineLocation ¶
type DiffLineLocation int
const ( DIFF_LINE_LOCATION_OUTSIDE DiffLineLocation = iota DIFF_LINE_LOCATION_CONTEXT DIFF_LINE_LOCATION_ADDED DIFF_LINE_LOCATION_REMOVED )
type MergeReq ¶
type MergeReq struct { Repo Repo `json:"-"` ID uint `json:"id"` Title string `json:"title"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Submitter Account `json:"submitter"` Assignee *Account `json:"assignee"` Reviewers []Account `json:"reviewers"` Description string `json:"description"` Versions []Series `json:"versions"` Threads []CommentThread `json:"threads"` State MergeReqState `json:"state"` Labels []string `json:"labels"` UpVotes int `json:"upVotes"` DownVotes int `json:"downVotes"` MergeStatus string `json:"mergeStatus"` MergeAfterPipeline bool `json:"mergeAfterPipeline"` SourceBranch string `json:"sourceBranch"` TargetBranch string `json:"targetBranch"` WIP bool `json:"wip"` Approvals Approvals `json:"approvals"` Metadata MergeReqMetadata `json:"bichonMetadata"` }
func NewMergeReqFromJSON ¶
func (*MergeReq) LocalBranch ¶
func (*MergeReq) ThreadIndexFromID ¶
type MergeReqFilter ¶
type MergeReqList ¶
type MergeReqList struct { Unfiltered []*MergeReq Active []*MergeReq Filter MergeReqFilter Sorter MergeReqSorter }
func (*MergeReqList) Insert ¶
func (mreqs *MergeReqList) Insert(mreq *MergeReq)
func (*MergeReqList) Len ¶
func (mreqs *MergeReqList) Len() int
func (*MergeReqList) Less ¶
func (mreqs *MergeReqList) Less(i, j int) bool
func (*MergeReqList) PurgeRepo ¶
func (mreqs *MergeReqList) PurgeRepo(repo *Repo)
func (*MergeReqList) Refresh ¶
func (mreqs *MergeReqList) Refresh()
func (*MergeReqList) Swap ¶
func (mreqs *MergeReqList) Swap(i, j int)
type MergeReqMetadata ¶
type MergeReqMetadata struct { Partial bool `json:"partial"` Status MergeReqStatus `json:"status"` }
type MergeReqState ¶
type MergeReqState string
const ( STATE_OPENED MergeReqState = "opened" STATE_CLOSED MergeReqState = "closed" STATE_MERGED MergeReqState = "merged" STATE_LOCKED MergeReqState = "locked" )
type MergeReqStatus ¶
type MergeReqStatus string
const ( STATUS_NEW MergeReqStatus = "new" STATUS_UPDATED MergeReqStatus = "updated" STATUS_OLD MergeReqStatus = "old" STATUS_READ MergeReqStatus = "read" )
type Repo ¶
type Repo struct { NickName string Directory string Remote string Server string Project string Token string GlobalToken bool State RepoState UpdatedAt *time.Time }
func NewRepoForDirectory ¶
type Series ¶
type SeriesMetadata ¶
type SeriesMetadata struct {
Partial bool `json:"partial"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.