Documentation ¶
Overview ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func Load(filename string, data interface{}, validation bool) error
- func Store(filename string, data interface{}) error
- type Comment
- type Commentable
- type Issue
- type Label
- type Milestone
- type Project
- type PullRequest
- type PullRequestBranch
- type Reaction
- type Release
- type ReleaseAsset
- type Repository
- type Review
- type ReviewComment
- type ReviewIndexType
- type Reviewable
- type Topic
Constants ¶
const ( RepositoryNameDefault = "" RepositoryNameWiki = ".wiki" )
const ( ReviewStatePending = "PENDING" ReviewStateApproved = "APPROVED" ReviewStateChangesRequested = "CHANGES_REQUESTED" ReviewStateCommented = "COMMENTED" ReviewStateRequestReview = "REQUEST_REVIEW" ReviewStateUnknown = "" )
enumerate all review states
Variables ¶
var RepositoryDefault = &Repository{Name: RepositoryNameDefault}
var RepositoryNames = []string{RepositoryNameDefault, RepositoryNameWiki}
Functions ¶
Types ¶
type Comment ¶
type Comment struct { IssueIndex int64 `json:"issue_index"` Index int64 `json:"index"` PosterID int64 `json:"poster_id"` PosterName string `json:"poster_name"` PosterEmail string `json:"poster_email"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Content string `json:"content"` Reactions []*Reaction `json:"reactions"` }
Comment is a standard comment information
func (*Comment) GetExternalID ¶
ExternalID ExternalUserMigrated interface
func (*Comment) GetExternalName ¶
GetExternalName ExternalUserMigrated interface
type Issue ¶
type Issue struct { Number int64 `json:"number"` PosterID int64 `json:"poster_id"` PosterName string `json:"poster_name"` PosterEmail string `json:"poster_email"` Title string `json:"title"` Content string `json:"content"` Milestone string `json:"milestone"` State string `json:"state"` // closed, open IsLocked bool `json:"is_locked"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Closed *time.Time `json:"closed"` Labels []*Label `json:"labels"` Reactions []*Reaction `json:"reactions"` Assignees []string `json:"assignees"` Ref string `json:"ref"` }
Issue is a standard issue information
func (*Issue) GetExternalID ¶
GetExternalID ExternalUserMigrated interface
func (*Issue) GetExternalName ¶
GetExternalName ExternalUserMigrated interface
func (*Issue) GetLocalIndex ¶
type Label ¶
type Label struct { Index int64 `json:"index"` Name string `json:"name"` Color string `json:"color"` Description string `json:"description"` }
Label defines a standard label information
type Milestone ¶
type Milestone struct { Index int64 `json:"index"` Title string `json:"title"` Description string `json:"description"` Deadline *time.Time `json:"deadline"` Created time.Time `json:"created"` Updated *time.Time `json:"updated"` Closed *time.Time `json:"closed"` State string `json:"state"` // open, closed }
Milestone defines a standard milestone
type Project ¶
type Project struct { Index int64 `json:"index"` Name string `json:"name"` Owner string `json:"owner"` IsPrivate bool `json:"is_private"` IsMirror bool `json:"is_mirror"` Description string `json:"description"` CloneURL string `json:"clone_url"` OriginalURL string `json:"original_url"` DefaultBranch string `json:"default_branch"` }
Project project
type PullRequest ¶
type PullRequest struct { Number int64 `json:"number"` PosterID int64 `json:"poster_id"` PosterName string `json:"poster_name"` PosterEmail string `json:"poster_email"` Title string `json:"title"` Content string `json:"content"` Milestone string `json:"milestone"` State string `json:"state"` // closed, open IsLocked bool `json:"is_locked"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Closed *time.Time `json:"closed"` Labels []*Label `json:"labels"` Reactions []*Reaction `json:"reactions"` Assignees []string `json:"assignees"` PatchURL string `json:"patch_url"` Merged bool `json:"merged"` MergedTime *time.Time `json:"merged_time"` MergeCommitSHA string `json:"merged_commit_sha"` Head PullRequestBranch `json:"head"` Base PullRequestBranch `json:"base"` Fetch func(directory string) string `json:"-"` }
PullRequest defines a standard pull request information
func (*PullRequest) GetExternalID ¶
func (p *PullRequest) GetExternalID() int64
ExternalID ExternalUserMigrated interface
func (*PullRequest) GetExternalName ¶
func (p *PullRequest) GetExternalName() string
GetExternalName ExternalUserMigrated interface
func (PullRequest) GetGitRefName ¶
func (p PullRequest) GetGitRefName() string
GetGitRefName returns pull request relative path to head
func (*PullRequest) GetID ¶
func (p *PullRequest) GetID() int64
func (*PullRequest) GetLocalIndex ¶
func (p *PullRequest) GetLocalIndex() int64
func (*PullRequest) IsForkPullRequest ¶
func (p *PullRequest) IsForkPullRequest() bool
IsForkPullRequest returns true if the pull request from a forked repository but not the same repository
func (*PullRequest) SetID ¶
func (p *PullRequest) SetID(id int64)
type PullRequestBranch ¶
type PullRequestBranch struct { CloneURL string `json:"clone_url"` Ref string `json:"ref"` SHA string `json:"sha"` RepoName string `json:"repo_name"` OwnerName string `json:"owner_name"` }
PullRequestBranch represents a pull request branch
func (PullRequestBranch) RepoPath ¶
func (p PullRequestBranch) RepoPath() string
RepoPath returns pull request repo path
type Reaction ¶
type Reaction struct { UserID int64 `json:"user_id"` UserName string `json:"user_name"` Content string `json:"content"` }
Reaction represents a reaction to an issue/pr/comment.
func (*Reaction) GetExternalID ¶
GetExternalID ExternalUserMigrated interface
func (*Reaction) GetExternalName ¶
GetExternalName ExternalUserMigrated interface
type Release ¶
type Release struct { ID int64 `json:"id"` TagName string `json:"tag_name"` TargetCommitish string `json:"target_commitish"` Name string `json:"name"` Body string `json:"body"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` PublisherID int64 `json:"publisher_id"` PublisherName string `json:"publisher_name"` PublisherEmail string `json:"publisher_email"` Assets []*ReleaseAsset `json:"assets"` Created time.Time `json:"created"` Published time.Time `json:"published"` }
Release represents a release
func (*Release) GetExternalID ¶
GetExternalID ExternalUserMigrated interface
func (*Release) GetExternalName ¶
GetExternalName ExternalUserMigrated interface
type ReleaseAsset ¶
type ReleaseAsset struct { ID int64 `json:"id"` Name string `json:"name"` ContentType *string `json:"content_type"` Size *int `json:"size"` DownloadCount *int `json:"download_count"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` DownloadURL *string `json:"download_url"` DownloadFunc func() io.ReadCloser `json:"-"` }
ReleaseAsset represents a release asset
func (*ReleaseAsset) GetID ¶
func (r *ReleaseAsset) GetID() int64
func (*ReleaseAsset) SetID ¶
func (r *ReleaseAsset) SetID(id int64)
type Repository ¶
type Review ¶
type Review struct { ID int64 `json:"id"` IssueIndex int64 `json:"issue_index"` ReviewerID int64 `json:"reviewer_id"` ReviewerName string `json:"reviewer_name"` Official bool `json:"official"` CommitID string `json:"commit_id"` Content string `json:"content"` CreatedAt time.Time `json:"created_at"` State string `json:"state"` Comments []*ReviewComment `json:"comments"` }
Review is a standard review information
func (*Review) GetExternalID ¶
ExternalID ExternalUserMigrated interface
func (*Review) GetExternalName ¶
GetExternalName ExternalUserMigrated interface
type ReviewComment ¶
type ReviewComment struct { ID int64 `json:"id"` InReplyTo int64 `json:"in_reply_to"` Content string `json:"content"` TreePath string `json:"tree_path"` DiffHunk string `json:"diff_hunk"` Position int `json:"position"` Line int `json:"line"` CommitID string `json:"commit_id"` PosterID int64 `json:"poster_id"` Reactions []*Reaction `json:"reactions"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
ReviewComment represents a review comment
func (*ReviewComment) GetID ¶
func (r *ReviewComment) GetID() int64
func (*ReviewComment) SetID ¶
func (r *ReviewComment) SetID(id int64)