Documentation ¶
Index ¶
- Variables
- func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string)
- type APIError
- type AccessToken
- type AccessTokenList
- type ActivityPub
- type AddCollaboratorOption
- type AddOrgMembershipOption
- type AddTimeOption
- type AnnotatedTag
- type AnnotatedTagObject
- type ApplyDiffPatchFileOptions
- type Attachment
- type Branch
- type BranchProtection
- type ChangedFile
- type ChangesFromPayload
- type ChangesPayload
- type CombinedStatus
- type Comment
- type Commit
- type CommitAffectedFiles
- type CommitDateOptions
- type CommitMeta
- type CommitStats
- type CommitStatus
- type CommitStatusState
- type CommitUser
- type ContentsResponse
- type CreateAccessTokenOption
- type CreateBranchProtectionOption
- type CreateBranchRepoOption
- type CreateEmailOption
- type CreateFileOptions
- type CreateForkOption
- type CreateGPGKeyOption
- type CreateHookOption
- type CreateHookOptionConfig
- type CreateIssueCommentOption
- type CreateIssueOption
- type CreateKeyOption
- type CreateLabelOption
- type CreateMilestoneOption
- type CreateOAuth2ApplicationOptions
- type CreateOrgOption
- type CreatePayload
- type CreatePullRequestOption
- type CreatePullReviewComment
- type CreatePullReviewOptions
- type CreatePushMirrorOption
- type CreateReleaseOption
- type CreateRepoOption
- type CreateStatusOption
- type CreateTagOption
- type CreateTeamOption
- type CreateUserOption
- type CreateWikiPageOptions
- type Cron
- type DeleteEmailOption
- type DeleteFileOptions
- type DeletePayload
- type DeployKey
- type DismissPullReviewOptions
- type EditAttachmentOptions
- type EditBranchProtectionOption
- type EditDeadlineOption
- type EditGitHookOption
- type EditHookOption
- type EditIssueCommentOption
- type EditIssueOption
- type EditLabelOption
- type EditMilestoneOption
- type EditOrgOption
- type EditPullRequestOption
- type EditReactionOption
- type EditReleaseOption
- type EditRepoOption
- type EditTeamOption
- type EditUserOption
- type Email
- type ExternalTracker
- type ExternalWiki
- type FileCommitResponse
- type FileDeleteResponse
- type FileLinksResponse
- type FileOptionInterface
- type FileOptions
- type FileResponse
- type ForkPayload
- type GPGKey
- type GPGKeyEmail
- type GeneralAPISettings
- type GeneralAttachmentSettings
- type GeneralRepoSettings
- type GeneralUISettings
- type GenerateRepoOption
- type GitBlobResponse
- type GitEntry
- type GitHook
- type GitHookList
- type GitObject
- type GitServiceType
- type GitTreeResponse
- type Hook
- type HookIssueAction
- type HookIssueCommentAction
- type HookList
- type HookPackageAction
- type HookReleaseAction
- type HookRepoAction
- type HookWikiAction
- type Identity
- type InternalTracker
- type Issue
- type IssueCommentPayload
- type IssueDeadline
- type IssueFormField
- type IssueFormFieldType
- type IssueLabelsOption
- type IssuePayload
- type IssueTemplate
- type IssueTemplateLabels
- type IssueTemplateType
- type LFSLock
- type LFSLockDeleteRequest
- type LFSLockError
- type LFSLockList
- type LFSLockListVerify
- type LFSLockOwner
- type LFSLockRequest
- type LFSLockResponse
- type Label
- type ListPullRequestsOptions
- type MarkdownOption
- type MarkdownRender
- type MigrateRepoOptions
- type Milestone
- type NodeInfo
- type NodeInfoServices
- type NodeInfoSoftware
- type NodeInfoUsage
- type NodeInfoUsageUsers
- type Note
- type NotificationCount
- type NotificationSubject
- type NotificationThread
- type NotifySubjectType
- type OAuth2Application
- type OAuth2ApplicationList
- type Organization
- type OrganizationPermissions
- type PRBranchInfo
- type Package
- type PackageFile
- type PackagePayload
- type PayloadCommit
- type PayloadCommitVerification
- type PayloadUser
- type Payloader
- type Permission
- type PublicKey
- type PullRequest
- type PullRequestMeta
- type PullRequestPayload
- type PullReview
- type PullReviewComment
- type PullReviewRequestOptions
- type PushMirror
- type PushPayload
- type PusherType
- type Reaction
- type Reference
- type Release
- type ReleasePayload
- type RepoCollaboratorPermission
- type RepoCommit
- type RepoTopicOptions
- type RepoTransfer
- type Repository
- type RepositoryMeta
- type RepositoryPayload
- type ReviewPayload
- type ReviewStateType
- type SearchError
- type SearchResults
- type ServerVersion
- type StateType
- type StopWatch
- type StopWatches
- type SubmitPullReviewOptions
- type Tag
- type TaskStatus
- type TaskType
- type Team
- type TimelineComment
- type TopicName
- type TopicResponse
- type TrackedTime
- type TrackedTimeList
- type TransferRepoOption
- type UpdateFileOptions
- type User
- type UserSettings
- type UserSettingsOptions
- type VerifyGPGKeyOption
- type VisibleType
- type WatchInfo
- type WikiCommit
- type WikiCommitList
- type WikiPage
- type WikiPageMetaData
- type WikiPayload
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidReceiveHook = errors.New("Invalid JSON payload received over webhook")
ErrInvalidReceiveHook FIXME
var SupportedFullGitService = []GitServiceType{ GithubService, GitlabService, GiteaService, GogsService, OneDevService, GitBucketService, CodebaseService, }
SupportedFullGitService represents all git services supported to migrate issues/labels/prs and etc. TODO: add to this list after new git service added
var VisibilityModes = map[string]VisibleType{ "public": VisibleTypePublic, "limited": VisibleTypeLimited, "private": VisibleTypePrivate, }
VisibilityModes is a map of org Visibility types
Functions ¶
func ExtractKeysFromMapString ¶
func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string)
ExtractKeysFromMapString provides a slice of keys from map
Types ¶
type AccessToken ¶ added in v1.9.0
type AccessToken struct { ID int64 `json:"id"` Name string `json:"name"` Token string `json:"sha1"` TokenLastEight string `json:"token_last_eight"` }
AccessToken represents an API access token. swagger:response AccessToken
type AccessTokenList ¶ added in v1.9.0
type AccessTokenList []*AccessToken
AccessTokenList represents a list of API access token. swagger:response AccessTokenList
type ActivityPub ¶ added in v1.17.4
type ActivityPub struct {
Context string `json:"@context"`
}
ActivityPub type
type AddCollaboratorOption ¶ added in v1.9.0
type AddCollaboratorOption struct {
Permission *string `json:"permission"`
}
AddCollaboratorOption options when adding a user as a collaborator of a repository
type AddOrgMembershipOption ¶ added in v1.9.0
type AddOrgMembershipOption struct {
Role string `json:"role" binding:"Required"`
}
AddOrgMembershipOption add user to organization options
type AddTimeOption ¶ added in v1.9.0
type AddTimeOption struct { // time in seconds // required: true Time int64 `json:"time" binding:"Required"` // swagger:strfmt date-time Created time.Time `json:"created"` // User who spent the time (optional) User string `json:"user_name"` }
AddTimeOption options for adding time to an issue
type AnnotatedTag ¶ added in v1.9.0
type AnnotatedTag struct { Tag string `json:"tag"` SHA string `json:"sha"` URL string `json:"url"` Message string `json:"message"` Tagger *CommitUser `json:"tagger"` Object *AnnotatedTagObject `json:"object"` Verification *PayloadCommitVerification `json:"verification"` }
AnnotatedTag represents an annotated tag
type AnnotatedTagObject ¶ added in v1.9.0
type AnnotatedTagObject struct { Type string `json:"type"` URL string `json:"url"` SHA string `json:"sha"` }
AnnotatedTagObject contains meta information of the tag object
type ApplyDiffPatchFileOptions ¶ added in v1.17.0
type ApplyDiffPatchFileOptions struct { DeleteFileOptions // required: true Content string `json:"content"` }
ApplyDiffPatchFileOptions options for applying a diff patch Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
type Attachment ¶ added in v1.9.0
type Attachment struct { ID int64 `json:"id"` Name string `json:"name"` Size int64 `json:"size"` DownloadCount int64 `json:"download_count"` // swagger:strfmt date-time Created time.Time `json:"created_at"` UUID string `json:"uuid"` DownloadURL string `json:"browser_download_url"` }
Attachment a generic attachment swagger:model
type Branch ¶ added in v1.9.0
type Branch struct { Name string `json:"name"` Commit *PayloadCommit `json:"commit"` Protected bool `json:"protected"` RequiredApprovals int64 `json:"required_approvals"` EnableStatusCheck bool `json:"enable_status_check"` StatusCheckContexts []string `json:"status_check_contexts"` UserCanPush bool `json:"user_can_push"` UserCanMerge bool `json:"user_can_merge"` EffectiveBranchProtectionName string `json:"effective_branch_protection_name"` }
Branch represents a repository branch
type BranchProtection ¶ added in v1.12.0
type BranchProtection struct { BranchName string `json:"branch_name"` EnablePush bool `json:"enable_push"` EnablePushWhitelist bool `json:"enable_push_whitelist"` PushWhitelistUsernames []string `json:"push_whitelist_usernames"` PushWhitelistTeams []string `json:"push_whitelist_teams"` PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"` EnableMergeWhitelist bool `json:"enable_merge_whitelist"` MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"` MergeWhitelistTeams []string `json:"merge_whitelist_teams"` EnableStatusCheck bool `json:"enable_status_check"` StatusCheckContexts []string `json:"status_check_contexts"` RequiredApprovals int64 `json:"required_approvals"` EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"` ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"` ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"` BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"` BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"` DismissStaleApprovals bool `json:"dismiss_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` }
BranchProtection represents a branch protection for a repository
type ChangedFile ¶ added in v1.17.4
type ChangedFile struct { Filename string `json:"filename"` PreviousFilename string `json:"previous_filename,omitempty"` Status string `json:"status"` Additions int `json:"additions"` Deletions int `json:"deletions"` Changes int `json:"changes"` HTMLURL string `json:"html_url,omitempty"` ContentsURL string `json:"contents_url,omitempty"` RawURL string `json:"raw_url,omitempty"` }
ChangedFile store information about files affected by the pull request
type ChangesFromPayload ¶ added in v1.9.0
type ChangesFromPayload struct {
From string `json:"from"`
}
ChangesFromPayload FIXME
type ChangesPayload ¶ added in v1.9.0
type ChangesPayload struct { Title *ChangesFromPayload `json:"title,omitempty"` Body *ChangesFromPayload `json:"body,omitempty"` Ref *ChangesFromPayload `json:"ref,omitempty"` }
ChangesPayload represents the payload information of issue change
type CombinedStatus ¶ added in v1.9.0
type CombinedStatus struct { State CommitStatusState `json:"state"` SHA string `json:"sha"` TotalCount int `json:"total_count"` Statuses []*CommitStatus `json:"statuses"` Repository *Repository `json:"repository"` CommitURL string `json:"commit_url"` URL string `json:"url"` }
CombinedStatus holds the combined state of several statuses for a single commit
type Comment ¶ added in v1.9.0
type Comment struct { ID int64 `json:"id"` HTMLURL string `json:"html_url"` PRURL string `json:"pull_request_url"` IssueURL string `json:"issue_url"` Poster *User `json:"user"` OriginalAuthor string `json:"original_author"` OriginalAuthorID int64 `json:"original_author_id"` Body string `json:"body"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` }
Comment represents a comment on a commit or issue
type Commit ¶ added in v1.9.0
type Commit struct { *CommitMeta HTMLURL string `json:"html_url"` RepoCommit *RepoCommit `json:"commit"` Author *User `json:"author"` Committer *User `json:"committer"` Parents []*CommitMeta `json:"parents"` Files []*CommitAffectedFiles `json:"files"` Stats *CommitStats `json:"stats"` }
Commit contains information generated from a Git commit.
type CommitAffectedFiles ¶ added in v1.14.0
type CommitAffectedFiles struct {
Filename string `json:"filename"`
}
CommitAffectedFiles store information about files affected by the commit
type CommitDateOptions ¶ added in v1.11.0
type CommitDateOptions struct { // swagger:strfmt date-time Author time.Time `json:"author"` // swagger:strfmt date-time Committer time.Time `json:"committer"` }
CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
type CommitMeta ¶ added in v1.9.0
type CommitMeta struct { URL string `json:"url"` SHA string `json:"sha"` // swagger:strfmt date-time Created time.Time `json:"created"` }
CommitMeta contains meta information of a commit in terms of API.
type CommitStats ¶ added in v1.17.0
type CommitStats struct { Total int `json:"total"` Additions int `json:"additions"` Deletions int `json:"deletions"` }
CommitStats is statistics for a RepoCommit
type CommitStatus ¶ added in v1.14.0
type CommitStatus struct { ID int64 `json:"id"` State CommitStatusState `json:"status"` TargetURL string `json:"target_url"` Description string `json:"description"` URL string `json:"url"` Context string `json:"context"` Creator *User `json:"creator"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` }
CommitStatus holds a single status of a single Commit
type CommitStatusState ¶ added in v1.11.0
type CommitStatusState string
CommitStatusState holds the state of a CommitStatus It can be "pending", "success", "error", "failure", and "warning"
const ( // CommitStatusPending is for when the CommitStatus is Pending CommitStatusPending CommitStatusState = "pending" // CommitStatusSuccess is for when the CommitStatus is Success CommitStatusSuccess CommitStatusState = "success" // CommitStatusError is for when the CommitStatus is Error CommitStatusError CommitStatusState = "error" // CommitStatusFailure is for when the CommitStatus is Failure CommitStatusFailure CommitStatusState = "failure" // CommitStatusWarning is for when the CommitStatus is Warning CommitStatusWarning CommitStatusState = "warning" )
func (CommitStatusState) IsError ¶ added in v1.11.0
func (css CommitStatusState) IsError() bool
IsError represents if commit status state is error
func (CommitStatusState) IsFailure ¶ added in v1.11.0
func (css CommitStatusState) IsFailure() bool
IsFailure represents if commit status state is failure
func (CommitStatusState) IsPending ¶ added in v1.11.0
func (css CommitStatusState) IsPending() bool
IsPending represents if commit status state is pending
func (CommitStatusState) IsSuccess ¶ added in v1.11.0
func (css CommitStatusState) IsSuccess() bool
IsSuccess represents if commit status state is success
func (CommitStatusState) IsWarning ¶ added in v1.11.0
func (css CommitStatusState) IsWarning() bool
IsWarning represents if commit status state is warning
func (CommitStatusState) NoBetterThan ¶ added in v1.11.0
func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool
NoBetterThan returns true if this State is no better than the given State
type CommitUser ¶ added in v1.9.0
CommitUser contains information of a user in the context of a commit.
type ContentsResponse ¶ added in v1.9.0
type ContentsResponse struct { Name string `json:"name"` Path string `json:"path"` SHA string `json:"sha"` LastCommitSHA string `json:"last_commit_sha"` // `type` will be `file`, `dir`, `symlink`, or `submodule` Type string `json:"type"` Size int64 `json:"size"` // `encoding` is populated when `type` is `file`, otherwise null Encoding *string `json:"encoding"` // `content` is populated when `type` is `file`, otherwise null Content *string `json:"content"` // `target` is populated when `type` is `symlink`, otherwise null Target *string `json:"target"` URL *string `json:"url"` HTMLURL *string `json:"html_url"` GitURL *string `json:"git_url"` DownloadURL *string `json:"download_url"` // `submodule_git_url` is populated when `type` is `submodule`, otherwise null SubmoduleGitURL *string `json:"submodule_git_url"` Links *FileLinksResponse `json:"_links"` }
ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
type CreateAccessTokenOption ¶ added in v1.9.0
type CreateAccessTokenOption struct {
Name string `json:"name" binding:"Required"`
}
CreateAccessTokenOption options when create access token swagger:parameters userCreateToken
type CreateBranchProtectionOption ¶ added in v1.12.0
type CreateBranchProtectionOption struct { BranchName string `json:"branch_name"` EnablePush bool `json:"enable_push"` EnablePushWhitelist bool `json:"enable_push_whitelist"` PushWhitelistUsernames []string `json:"push_whitelist_usernames"` PushWhitelistTeams []string `json:"push_whitelist_teams"` PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"` EnableMergeWhitelist bool `json:"enable_merge_whitelist"` MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"` MergeWhitelistTeams []string `json:"merge_whitelist_teams"` EnableStatusCheck bool `json:"enable_status_check"` StatusCheckContexts []string `json:"status_check_contexts"` RequiredApprovals int64 `json:"required_approvals"` EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"` ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"` ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"` BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"` BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"` DismissStaleApprovals bool `json:"dismiss_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` }
CreateBranchProtectionOption options for creating a branch protection
type CreateBranchRepoOption ¶ added in v1.13.0
type CreateBranchRepoOption struct { // Name of the branch to create // // required: true // unique: true BranchName string `json:"new_branch_name" binding:"Required;GitRefName;MaxSize(100)"` // Name of the old branch to create from // // unique: true OldBranchName string `json:"old_branch_name" binding:"GitRefName;MaxSize(100)"` }
CreateBranchRepoOption options when creating a branch in a repository swagger:model
type CreateEmailOption ¶ added in v1.9.0
type CreateEmailOption struct { // email addresses to add Emails []string `json:"emails"` }
CreateEmailOption options when creating email addresses
type CreateFileOptions ¶ added in v1.9.0
type CreateFileOptions struct { FileOptions // content must be base64 encoded // required: true Content string `json:"content"` }
CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
func (*CreateFileOptions) Branch ¶ added in v1.17.0
func (o *CreateFileOptions) Branch() string
Branch returns branch name
type CreateForkOption ¶ added in v1.9.0
type CreateForkOption struct { // organization name, if forking into an organization Organization *string `json:"organization"` // name of the forked repository Name *string `json:"name"` }
CreateForkOption options for creating a fork
type CreateGPGKeyOption ¶ added in v1.9.0
type CreateGPGKeyOption struct { // An armored GPG key to add // // required: true // unique: true ArmoredKey string `json:"armored_public_key" binding:"Required"` Signature string `json:"armored_signature,omitempty"` }
CreateGPGKeyOption options create user GPG key
type CreateHookOption ¶ added in v1.9.0
type CreateHookOption struct { // required: true // enum: dingtalk,discord,gitea,gogs,msteams,slack,telegram,feishu,wechatwork,packagist Type string `json:"type" binding:"Required"` // required: true Config CreateHookOptionConfig `json:"config" binding:"Required"` Events []string `json:"events"` BranchFilter string `json:"branch_filter" binding:"GlobPattern"` // default: false Active bool `json:"active"` }
CreateHookOption options when create a hook
type CreateHookOptionConfig ¶ added in v1.11.0
CreateHookOptionConfig has all config options in it required are "content_type" and "url" Required
type CreateIssueCommentOption ¶ added in v1.9.0
type CreateIssueCommentOption struct { // required:true Body string `json:"body" binding:"Required"` }
CreateIssueCommentOption options for creating a comment on an issue
type CreateIssueOption ¶ added in v1.9.0
type CreateIssueOption struct { // required:true Title string `json:"title" binding:"Required"` Body string `json:"body"` Ref string `json:"ref"` // deprecated Assignee string `json:"assignee"` Assignees []string `json:"assignees"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` // milestone id Milestone int64 `json:"milestone"` // list of label ids Labels []int64 `json:"labels"` Closed bool `json:"closed"` }
CreateIssueOption options to create one issue
type CreateKeyOption ¶ added in v1.9.0
type CreateKeyOption struct { // Title of the key to add // // required: true // unique: true Title string `json:"title" binding:"Required"` // An armored SSH key to add // // required: true // unique: true Key string `json:"key" binding:"Required"` // Describe if the key has only read access or read/write // // required: false ReadOnly bool `json:"read_only"` }
CreateKeyOption options when creating a key
type CreateLabelOption ¶ added in v1.9.0
type CreateLabelOption struct { // required:true Name string `json:"name" binding:"Required"` // required:true // example: #00aabb Color string `json:"color" binding:"Required"` Description string `json:"description"` }
CreateLabelOption options for creating a label
type CreateMilestoneOption ¶ added in v1.9.0
type CreateMilestoneOption struct { Title string `json:"title"` Description string `json:"description"` // swagger:strfmt date-time Deadline *time.Time `json:"due_on"` // enum: open,closed State string `json:"state"` }
CreateMilestoneOption options for creating a milestone
type CreateOAuth2ApplicationOptions ¶ added in v1.12.0
type CreateOAuth2ApplicationOptions struct { Name string `json:"name" binding:"Required"` ConfidentialClient bool `json:"confidential_client"` RedirectURIs []string `json:"redirect_uris" binding:"Required"` }
CreateOAuth2ApplicationOptions holds options to create an oauth2 application
type CreateOrgOption ¶ added in v1.9.0
type CreateOrgOption struct { // required: true UserName string `json:"username" binding:"Required"` FullName string `json:"full_name"` Description string `json:"description" binding:"MaxSize(255)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public` (default), `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility" binding:"In(,public,limited,private)"` RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"` }
CreateOrgOption options for creating an organization
type CreatePayload ¶ added in v1.9.0
type CreatePayload struct { Sha string `json:"sha"` Ref string `json:"ref"` RefType string `json:"ref_type"` Repo *Repository `json:"repository"` Sender *User `json:"sender"` }
CreatePayload FIXME
func ParseCreateHook ¶ added in v1.9.0
func ParseCreateHook(raw []byte) (*CreatePayload, error)
ParseCreateHook parses create event hook content.
func (*CreatePayload) JSONPayload ¶ added in v1.9.0
func (p *CreatePayload) JSONPayload() ([]byte, error)
JSONPayload return payload information
type CreatePullRequestOption ¶ added in v1.9.0
type CreatePullRequestOption struct { Head string `json:"head" binding:"Required"` Base string `json:"base" binding:"Required"` Title string `json:"title" binding:"Required"` Body string `json:"body"` Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Milestone int64 `json:"milestone"` Labels []int64 `json:"labels"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` }
CreatePullRequestOption options when creating a pull request
type CreatePullReviewComment ¶ added in v1.12.0
type CreatePullReviewComment struct { // the tree path Path string `json:"path"` Body string `json:"body"` // if comment to old file line or 0 OldLineNum int64 `json:"old_position"` // if comment to new file line or 0 NewLineNum int64 `json:"new_position"` }
CreatePullReviewComment represent a review comment for creation api
type CreatePullReviewOptions ¶ added in v1.12.0
type CreatePullReviewOptions struct { Event ReviewStateType `json:"event"` Body string `json:"body"` CommitID string `json:"commit_id"` Comments []CreatePullReviewComment `json:"comments"` }
CreatePullReviewOptions are options to create a pull review
type CreatePushMirrorOption ¶ added in v1.17.4
type CreatePushMirrorOption struct { RemoteAddress string `json:"remote_address"` RemoteUsername string `json:"remote_username"` RemotePassword string `json:"remote_password"` Interval string `json:"interval"` }
CreatePushMirrorOption represents need information to create a push mirror of a repository.
type CreateReleaseOption ¶ added in v1.9.0
type CreateReleaseOption struct { // required: true TagName string `json:"tag_name" binding:"Required"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` IsDraft bool `json:"draft"` IsPrerelease bool `json:"prerelease"` }
CreateReleaseOption options when creating a release
type CreateRepoOption ¶ added in v1.9.0
type CreateRepoOption struct { // Name of the repository to create // // required: true // unique: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"` // Description of the repository to create Description string `json:"description" binding:"MaxSize(2048)"` // Whether the repository is private Private bool `json:"private"` // Label-Set to use IssueLabels string `json:"issue_labels"` // Whether the repository should be auto-initialized? AutoInit bool `json:"auto_init"` // Whether the repository is template Template bool `json:"template"` // Gitignores to use Gitignores string `json:"gitignores"` // License to use License string `json:"license"` // Readme of the repository to create Readme string `json:"readme"` // DefaultBranch of the repository (used when initializes and in template) DefaultBranch string `json:"default_branch" binding:"GitRefName;MaxSize(100)"` // TrustModel of the repository // enum: default,collaborator,committer,collaboratorcommitter TrustModel string `json:"trust_model"` }
CreateRepoOption options when creating repository swagger:model
type CreateStatusOption ¶ added in v1.9.0
type CreateStatusOption struct { State CommitStatusState `json:"state"` TargetURL string `json:"target_url"` Description string `json:"description"` Context string `json:"context"` }
CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
type CreateTagOption ¶ added in v1.15.0
type CreateTagOption struct { // required: true TagName string `json:"tag_name" binding:"Required"` Message string `json:"message"` Target string `json:"target"` }
CreateTagOption options when creating a tag
type CreateTeamOption ¶ added in v1.9.0
type CreateTeamOption struct { // required: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"` Description string `json:"description" binding:"MaxSize(255)"` IncludesAllRepositories bool `json:"includes_all_repositories"` // enum: read,write,admin Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"] // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions. Units []string `json:"units"` // example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"} UnitsMap map[string]string `json:"units_map"` CanCreateOrgRepo bool `json:"can_create_org_repo"` }
CreateTeamOption options for creating a team
type CreateUserOption ¶ added in v1.9.0
type CreateUserOption struct { SourceID int64 `json:"source_id"` LoginName string `json:"login_name"` // required: true Username string `json:"username" binding:"Required;AlphaDashDot;MaxSize(40)"` FullName string `json:"full_name" binding:"MaxSize(100)"` // required: true // swagger:strfmt email Email string `json:"email" binding:"Required;Email;MaxSize(254)"` // required: true Password string `json:"password" binding:"Required;MaxSize(255)"` MustChangePassword *bool `json:"must_change_password"` SendNotify bool `json:"send_notify"` Restricted *bool `json:"restricted"` Visibility string `json:"visibility" binding:"In(,public,limited,private)"` }
CreateUserOption create user options
type CreateWikiPageOptions ¶ added in v1.16.0
type CreateWikiPageOptions struct { // page title. leave empty to keep unchanged Title string `json:"title"` // content must be base64 encoded ContentBase64 string `json:"content_base64"` // optional commit message summarizing the change Message string `json:"message"` }
CreateWikiPageOptions form for creating wiki
type Cron ¶ added in v1.13.0
type Cron struct { Name string `json:"name"` Schedule string `json:"schedule"` Next time.Time `json:"next"` Prev time.Time `json:"prev"` ExecTimes int64 `json:"exec_times"` }
Cron represents a Cron task
type DeleteEmailOption ¶ added in v1.9.0
type DeleteEmailOption struct { // email addresses to delete Emails []string `json:"emails"` }
DeleteEmailOption options when deleting email addresses
type DeleteFileOptions ¶ added in v1.9.0
type DeleteFileOptions struct { FileOptions // sha is the SHA for the file that already exists // required: true SHA string `json:"sha" binding:"Required"` }
DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
func (*DeleteFileOptions) Branch ¶ added in v1.17.0
func (o *DeleteFileOptions) Branch() string
Branch returns branch name
type DeletePayload ¶ added in v1.9.0
type DeletePayload struct { Ref string `json:"ref"` RefType string `json:"ref_type"` PusherType PusherType `json:"pusher_type"` Repo *Repository `json:"repository"` Sender *User `json:"sender"` }
DeletePayload represents delete payload
func (*DeletePayload) JSONPayload ¶ added in v1.9.0
func (p *DeletePayload) JSONPayload() ([]byte, error)
JSONPayload implements Payload
type DeployKey ¶ added in v1.9.0
type DeployKey struct { ID int64 `json:"id"` KeyID int64 `json:"key_id"` Key string `json:"key"` URL string `json:"url"` Title string `json:"title"` Fingerprint string `json:"fingerprint"` // swagger:strfmt date-time Created time.Time `json:"created_at"` ReadOnly bool `json:"read_only"` Repository *Repository `json:"repository,omitempty"` }
DeployKey a deploy key
type DismissPullReviewOptions ¶ added in v1.14.0
type DismissPullReviewOptions struct { Message string `json:"message"` Priors bool `json:"priors"` }
DismissPullReviewOptions are options to dismiss a pull review
type EditAttachmentOptions ¶ added in v1.9.0
type EditAttachmentOptions struct {
Name string `json:"name"`
}
EditAttachmentOptions options for editing attachments swagger:model
type EditBranchProtectionOption ¶ added in v1.12.0
type EditBranchProtectionOption struct { EnablePush *bool `json:"enable_push"` EnablePushWhitelist *bool `json:"enable_push_whitelist"` PushWhitelistUsernames []string `json:"push_whitelist_usernames"` PushWhitelistTeams []string `json:"push_whitelist_teams"` PushWhitelistDeployKeys *bool `json:"push_whitelist_deploy_keys"` EnableMergeWhitelist *bool `json:"enable_merge_whitelist"` MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"` MergeWhitelistTeams []string `json:"merge_whitelist_teams"` EnableStatusCheck *bool `json:"enable_status_check"` StatusCheckContexts []string `json:"status_check_contexts"` RequiredApprovals *int64 `json:"required_approvals"` EnableApprovalsWhitelist *bool `json:"enable_approvals_whitelist"` ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"` ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"` BlockOnRejectedReviews *bool `json:"block_on_rejected_reviews"` BlockOnOfficialReviewRequests *bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch *bool `json:"block_on_outdated_branch"` DismissStaleApprovals *bool `json:"dismiss_stale_approvals"` RequireSignedCommits *bool `json:"require_signed_commits"` ProtectedFilePatterns *string `json:"protected_file_patterns"` UnprotectedFilePatterns *string `json:"unprotected_file_patterns"` }
EditBranchProtectionOption options for editing a branch protection
type EditDeadlineOption ¶ added in v1.9.0
type EditDeadlineOption struct { // required:true // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` }
EditDeadlineOption options for creating a deadline
type EditGitHookOption ¶ added in v1.9.0
type EditGitHookOption struct {
Content string `json:"content"`
}
EditGitHookOption options when modifying one Git hook
type EditHookOption ¶ added in v1.9.0
type EditHookOption struct { Config map[string]string `json:"config"` Events []string `json:"events"` BranchFilter string `json:"branch_filter" binding:"GlobPattern"` Active *bool `json:"active"` }
EditHookOption options when modify one hook
type EditIssueCommentOption ¶ added in v1.9.0
type EditIssueCommentOption struct { // required: true Body string `json:"body" binding:"Required"` }
EditIssueCommentOption options for editing a comment
type EditIssueOption ¶ added in v1.9.0
type EditIssueOption struct { Title string `json:"title"` Body *string `json:"body"` Ref *string `json:"ref"` // deprecated Assignee *string `json:"assignee"` Assignees []string `json:"assignees"` Milestone *int64 `json:"milestone"` State *string `json:"state"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` RemoveDeadline *bool `json:"unset_due_date"` }
EditIssueOption options for editing an issue
type EditLabelOption ¶ added in v1.9.0
type EditLabelOption struct { Name *string `json:"name"` Color *string `json:"color"` Description *string `json:"description"` }
EditLabelOption options for editing a label
type EditMilestoneOption ¶ added in v1.9.0
type EditMilestoneOption struct { Title string `json:"title"` Description *string `json:"description"` State *string `json:"state"` Deadline *time.Time `json:"due_on"` }
EditMilestoneOption options for editing a milestone
type EditOrgOption ¶ added in v1.9.0
type EditOrgOption struct { FullName string `json:"full_name"` Description string `json:"description" binding:"MaxSize(255)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public`, `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility" binding:"In(,public,limited,private)"` RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"` }
EditOrgOption options for editing an organization
type EditPullRequestOption ¶ added in v1.9.0
type EditPullRequestOption struct { Title string `json:"title"` Body string `json:"body"` Base string `json:"base"` Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Milestone int64 `json:"milestone"` Labels []int64 `json:"labels"` State *string `json:"state"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` RemoveDeadline *bool `json:"unset_due_date"` AllowMaintainerEdit *bool `json:"allow_maintainer_edit"` }
EditPullRequestOption options when modify pull request
type EditReactionOption ¶ added in v1.11.0
type EditReactionOption struct {
Reaction string `json:"content"`
}
EditReactionOption contain the reaction type
type EditReleaseOption ¶ added in v1.9.0
type EditReleaseOption struct { TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` IsDraft *bool `json:"draft"` IsPrerelease *bool `json:"prerelease"` }
EditReleaseOption options when editing a release
type EditRepoOption ¶ added in v1.9.0
type EditRepoOption struct { // name of the repository // unique: true Name *string `json:"name,omitempty" binding:"OmitEmpty;AlphaDashDot;MaxSize(100);"` // a short description of the repository. Description *string `json:"description,omitempty" binding:"MaxSize(2048)"` // a URL with more information about the repository. Website *string `json:"website,omitempty" binding:"MaxSize(1024)"` // either `true` to make the repository private or `false` to make it public. // Note: you will get a 422 error if the organization restricts changing repository visibility to organization // owners and a non-owner tries to change the value of private. Private *bool `json:"private,omitempty"` // either `true` to make this repository a template or `false` to make it a normal repository Template *bool `json:"template,omitempty"` // either `true` to enable issues for this repository or `false` to disable them. HasIssues *bool `json:"has_issues,omitempty"` // set this structure to configure internal issue tracker InternalTracker *InternalTracker `json:"internal_tracker,omitempty"` // set this structure to use external issue tracker ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"` // either `true` to enable the wiki for this repository or `false` to disable it. HasWiki *bool `json:"has_wiki,omitempty"` // set this structure to use external wiki instead of internal ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"` // sets the default branch for this repository. DefaultBranch *string `json:"default_branch,omitempty"` // either `true` to allow pull requests, or `false` to prevent pull request. HasPullRequests *bool `json:"has_pull_requests,omitempty"` // either `true` to enable project unit, or `false` to disable them. HasProjects *bool `json:"has_projects,omitempty"` // either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. IgnoreWhitespaceConflicts *bool `json:"ignore_whitespace_conflicts,omitempty"` // either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. AllowMerge *bool `json:"allow_merge_commits,omitempty"` // either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. AllowRebase *bool `json:"allow_rebase,omitempty"` // either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. AllowRebaseMerge *bool `json:"allow_rebase_explicit,omitempty"` // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. AllowSquash *bool `json:"allow_squash_merge,omitempty"` // either `true` to allow mark pr as merged manually, or `false` to prevent it. AllowManualMerge *bool `json:"allow_manual_merge,omitempty"` // either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur. AutodetectManualMerge *bool `json:"autodetect_manual_merge,omitempty"` // either `true` to allow updating pull request branch by rebase, or `false` to prevent it. AllowRebaseUpdate *bool `json:"allow_rebase_update,omitempty"` // set to `true` to delete pr branch after merge by default DefaultDeleteBranchAfterMerge *bool `json:"default_delete_branch_after_merge,omitempty"` // set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash". DefaultMergeStyle *string `json:"default_merge_style,omitempty"` // set to `true` to archive this repository. Archived *bool `json:"archived,omitempty"` // set to a string like `8h30m0s` to set the mirror interval time MirrorInterval *string `json:"mirror_interval,omitempty"` // enable prune - remove obsolete remote-tracking references EnablePrune *bool `json:"enable_prune,omitempty"` }
EditRepoOption options when editing a repository's properties swagger:model
type EditTeamOption ¶ added in v1.9.0
type EditTeamOption struct { // required: true Name string `json:"name" binding:"AlphaDashDot;MaxSize(30)"` Description *string `json:"description" binding:"MaxSize(255)"` IncludesAllRepositories *bool `json:"includes_all_repositories"` // enum: read,write,admin Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"] // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions. Units []string `json:"units"` // example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"} UnitsMap map[string]string `json:"units_map"` CanCreateOrgRepo *bool `json:"can_create_org_repo"` }
EditTeamOption options for editing a team
type EditUserOption ¶ added in v1.9.0
type EditUserOption struct { // required: true SourceID int64 `json:"source_id"` // required: true LoginName string `json:"login_name" binding:"Required"` // swagger:strfmt email Email *string `json:"email" binding:"MaxSize(254)"` FullName *string `json:"full_name" binding:"MaxSize(100)"` Password string `json:"password" binding:"MaxSize(255)"` MustChangePassword *bool `json:"must_change_password"` Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"` Location *string `json:"location" binding:"MaxSize(50)"` Description *string `json:"description" binding:"MaxSize(255)"` Active *bool `json:"active"` Admin *bool `json:"admin"` AllowGitHook *bool `json:"allow_git_hook"` AllowImportLocal *bool `json:"allow_import_local"` MaxRepoCreation *int `json:"max_repo_creation"` ProhibitLogin *bool `json:"prohibit_login"` AllowCreateOrganization *bool `json:"allow_create_organization"` Restricted *bool `json:"restricted"` Visibility string `json:"visibility" binding:"In(,public,limited,private)"` }
EditUserOption edit user options
type Email ¶ added in v1.9.0
type Email struct { // swagger:strfmt email Email string `json:"email"` Verified bool `json:"verified"` Primary bool `json:"primary"` }
Email an email address belonging to a user
type ExternalTracker ¶ added in v1.10.0
type ExternalTracker struct { // URL of external issue tracker. ExternalTrackerURL string `json:"external_tracker_url"` // External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. ExternalTrackerFormat string `json:"external_tracker_format"` // External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp` ExternalTrackerStyle string `json:"external_tracker_style"` // External Issue Tracker issue regular expression ExternalTrackerRegexpPattern string `json:"external_tracker_regexp_pattern"` }
ExternalTracker represents settings for external tracker swagger:model
type ExternalWiki ¶ added in v1.10.0
type ExternalWiki struct { // URL of external wiki. ExternalWikiURL string `json:"external_wiki_url"` }
ExternalWiki represents setting for external wiki swagger:model
type FileCommitResponse ¶ added in v1.9.0
type FileCommitResponse struct { CommitMeta HTMLURL string `json:"html_url"` Author *CommitUser `json:"author"` Committer *CommitUser `json:"committer"` Parents []*CommitMeta `json:"parents"` Message string `json:"message"` Tree *CommitMeta `json:"tree"` }
FileCommitResponse contains information generated from a Git commit for a repo's file.
type FileDeleteResponse ¶ added in v1.9.0
type FileDeleteResponse struct { Content interface{} `json:"content"` // to be set to nil Commit *FileCommitResponse `json:"commit"` Verification *PayloadCommitVerification `json:"verification"` }
FileDeleteResponse contains information about a repo's file that was deleted
type FileLinksResponse ¶ added in v1.9.0
type FileLinksResponse struct { Self *string `json:"self"` GitURL *string `json:"git"` HTMLURL *string `json:"html"` }
FileLinksResponse contains the links for a repo's file
type FileOptionInterface ¶ added in v1.17.0
type FileOptionInterface interface {
Branch() string
}
FileOptionInterface provides a unified interface for the different file options
type FileOptions ¶ added in v1.9.0
type FileOptions struct { // message (optional) for the commit of this file. if not supplied, a default message will be used Message string `json:"message"` // branch (optional) to base this file from. if not given, the default branch is used BranchName string `json:"branch" binding:"GitRefName;MaxSize(100)"` // new_branch (optional) will make a new branch from `branch` before creating the file NewBranchName string `json:"new_branch" binding:"GitRefName;MaxSize(100)"` // `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) Author Identity `json:"author"` Committer Identity `json:"committer"` Dates CommitDateOptions `json:"dates"` // Add a Signed-off-by trailer by the committer at the end of the commit log message. Signoff bool `json:"signoff"` }
FileOptions options for all file APIs
type FileResponse ¶ added in v1.9.0
type FileResponse struct { Content *ContentsResponse `json:"content"` Commit *FileCommitResponse `json:"commit"` Verification *PayloadCommitVerification `json:"verification"` }
FileResponse contains information about a repo's file
type ForkPayload ¶ added in v1.9.0
type ForkPayload struct { Forkee *Repository `json:"forkee"` Repo *Repository `json:"repository"` Sender *User `json:"sender"` }
ForkPayload represents fork payload
func (*ForkPayload) JSONPayload ¶ added in v1.9.0
func (p *ForkPayload) JSONPayload() ([]byte, error)
JSONPayload implements Payload
type GPGKey ¶ added in v1.9.0
type GPGKey struct { ID int64 `json:"id"` PrimaryKeyID string `json:"primary_key_id"` KeyID string `json:"key_id"` PublicKey string `json:"public_key"` Emails []*GPGKeyEmail `json:"emails"` SubsKey []*GPGKey `json:"subkeys"` CanSign bool `json:"can_sign"` CanEncryptComms bool `json:"can_encrypt_comms"` CanEncryptStorage bool `json:"can_encrypt_storage"` CanCertify bool `json:"can_certify"` Verified bool `json:"verified"` // swagger:strfmt date-time Created time.Time `json:"created_at,omitempty"` // swagger:strfmt date-time Expires time.Time `json:"expires_at,omitempty"` }
GPGKey a user GPG key to sign commit and tag in repository
type GPGKeyEmail ¶ added in v1.9.0
GPGKeyEmail an email attached to a GPGKey swagger:model GPGKeyEmail
type GeneralAPISettings ¶ added in v1.13.0
type GeneralAPISettings struct { MaxResponseItems int `json:"max_response_items"` DefaultPagingNum int `json:"default_paging_num"` DefaultGitTreesPerPage int `json:"default_git_trees_per_page"` DefaultMaxBlobSize int64 `json:"default_max_blob_size"` }
GeneralAPISettings contains global api settings exposed by it
type GeneralAttachmentSettings ¶ added in v1.13.0
type GeneralAttachmentSettings struct { Enabled bool `json:"enabled"` AllowedTypes string `json:"allowed_types"` MaxSize int64 `json:"max_size"` MaxFiles int `json:"max_files"` }
GeneralAttachmentSettings contains global Attachment settings exposed by API
type GeneralRepoSettings ¶ added in v1.13.0
type GeneralRepoSettings struct { MirrorsDisabled bool `json:"mirrors_disabled"` HTTPGitDisabled bool `json:"http_git_disabled"` MigrationsDisabled bool `json:"migrations_disabled"` StarsDisabled bool `json:"stars_disabled"` TimeTrackingDisabled bool `json:"time_tracking_disabled"` LFSDisabled bool `json:"lfs_disabled"` }
GeneralRepoSettings contains global repository settings exposed by API
type GeneralUISettings ¶ added in v1.13.0
type GeneralUISettings struct { DefaultTheme string `json:"default_theme"` AllowedReactions []string `json:"allowed_reactions"` CustomEmojis []string `json:"custom_emojis"` }
GeneralUISettings contains global ui settings exposed by API
type GenerateRepoOption ¶ added in v1.15.0
type GenerateRepoOption struct { // The organization or person who will own the new repository // // required: true Owner string `json:"owner"` // Name of the repository to create // // required: true // unique: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"` // Default branch of the new repository DefaultBranch string `json:"default_branch"` // Description of the repository to create Description string `json:"description" binding:"MaxSize(2048)"` // Whether the repository is private Private bool `json:"private"` // include git content of default branch in template repo GitContent bool `json:"git_content"` // include topics in template repo Topics bool `json:"topics"` // include git hooks in template repo GitHooks bool `json:"git_hooks"` // include webhooks in template repo Webhooks bool `json:"webhooks"` // include avatar of the template repo Avatar bool `json:"avatar"` // include labels in template repo Labels bool `json:"labels"` }
GenerateRepoOption options when creating repository using a template swagger:model
type GitBlobResponse ¶ added in v1.9.0
type GitBlobResponse struct { Content string `json:"content"` Encoding string `json:"encoding"` URL string `json:"url"` SHA string `json:"sha"` Size int64 `json:"size"` }
GitBlobResponse represents a git blob
type GitEntry ¶ added in v1.9.0
type GitEntry struct { Path string `json:"path"` Mode string `json:"mode"` Type string `json:"type"` Size int64 `json:"size"` SHA string `json:"sha"` URL string `json:"url"` }
GitEntry represents a git tree
type GitHook ¶ added in v1.9.0
type GitHook struct { Name string `json:"name"` IsActive bool `json:"is_active"` Content string `json:"content,omitempty"` }
GitHook represents a Git repository hook
type GitHookList ¶ added in v1.9.0
type GitHookList []*GitHook
GitHookList represents a list of Git hooks
type GitServiceType ¶ added in v1.10.0
type GitServiceType int
GitServiceType represents a git service
const ( NotMigrated GitServiceType = iota // 0 not migrated from external sites PlainGitService // 1 plain git service GithubService // 2 github.com GiteaService // 3 gitea service GitlabService // 4 gitlab service GogsService // 5 gogs service OneDevService // 6 onedev service GitBucketService // 7 gitbucket service CodebaseService // 8 codebase service )
enumerate all GitServiceType
func (GitServiceType) Name ¶ added in v1.10.0
func (gt GitServiceType) Name() string
Name represents the service type's name WARNNING: the name have to be equal to that on goth's library
func (GitServiceType) Title ¶ added in v1.13.0
func (gt GitServiceType) Title() string
Title represents the service type's proper title
func (GitServiceType) TokenAuth ¶ added in v1.13.0
func (gt GitServiceType) TokenAuth() bool
TokenAuth represents whether a service type supports token-based auth
type GitTreeResponse ¶ added in v1.9.0
type GitTreeResponse struct { SHA string `json:"sha"` URL string `json:"url"` Entries []GitEntry `json:"tree"` Truncated bool `json:"truncated"` Page int `json:"page"` TotalCount int `json:"total_count"` }
GitTreeResponse returns a git tree
type Hook ¶ added in v1.9.0
type Hook struct { ID int64 `json:"id"` Type string `json:"type"` URL string `json:"-"` Config map[string]string `json:"config"` Events []string `json:"events"` Active bool `json:"active"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` // swagger:strfmt date-time Created time.Time `json:"created_at"` }
Hook a hook is a web hook when one repository changed
type HookIssueAction ¶ added in v1.9.0
type HookIssueAction string
HookIssueAction FIXME
const ( // HookIssueOpened opened HookIssueOpened HookIssueAction = "opened" // HookIssueClosed closed HookIssueClosed HookIssueAction = "closed" // HookIssueReOpened reopened HookIssueReOpened HookIssueAction = "reopened" // HookIssueEdited edited HookIssueEdited HookIssueAction = "edited" // HookIssueAssigned assigned HookIssueAssigned HookIssueAction = "assigned" // HookIssueUnassigned unassigned HookIssueUnassigned HookIssueAction = "unassigned" // HookIssueLabelUpdated label_updated HookIssueLabelUpdated HookIssueAction = "label_updated" // HookIssueLabelCleared label_cleared HookIssueLabelCleared HookIssueAction = "label_cleared" // HookIssueSynchronized synchronized HookIssueSynchronized HookIssueAction = "synchronized" // HookIssueMilestoned is an issue action for when a milestone is set on an issue. HookIssueMilestoned HookIssueAction = "milestoned" // HookIssueDemilestoned is an issue action for when a milestone is cleared on an issue. HookIssueDemilestoned HookIssueAction = "demilestoned" // HookIssueReviewed is an issue action for when a pull request is reviewed HookIssueReviewed HookIssueAction = "reviewed" )
type HookIssueCommentAction ¶ added in v1.9.0
type HookIssueCommentAction string
HookIssueCommentAction defines hook issue comment action
const ( HookIssueCommentCreated HookIssueCommentAction = "created" HookIssueCommentEdited HookIssueCommentAction = "edited" HookIssueCommentDeleted HookIssueCommentAction = "deleted" )
all issue comment actions
type HookPackageAction ¶ added in v1.17.0
type HookPackageAction string
HookPackageAction an action that happens to a package
const ( // HookPackageCreated created HookPackageCreated HookPackageAction = "created" // HookPackageDeleted deleted HookPackageDeleted HookPackageAction = "deleted" )
type HookReleaseAction ¶ added in v1.9.0
type HookReleaseAction string
HookReleaseAction defines hook release action type
const ( HookReleasePublished HookReleaseAction = "published" HookReleaseUpdated HookReleaseAction = "updated" HookReleaseDeleted HookReleaseAction = "deleted" )
all release actions
type HookRepoAction ¶ added in v1.9.0
type HookRepoAction string
HookRepoAction an action that happens to a repo
const ( // HookRepoCreated created HookRepoCreated HookRepoAction = "created" // HookRepoDeleted deleted HookRepoDeleted HookRepoAction = "deleted" )
type HookWikiAction ¶ added in v1.17.4
type HookWikiAction string
HookWikiAction an action that happens to a wiki page
const ( // HookWikiCreated created HookWikiCreated HookWikiAction = "created" // HookWikiEdited edited HookWikiEdited HookWikiAction = "edited" // HookWikiDeleted deleted HookWikiDeleted HookWikiAction = "deleted" )
type Identity ¶ added in v1.9.0
type Identity struct { Name string `json:"name" binding:"MaxSize(100)"` // swagger:strfmt email Email string `json:"email" binding:"MaxSize(254)"` }
Identity for a person's identity like an author or committer
type InternalTracker ¶ added in v1.10.0
type InternalTracker struct { // Enable time tracking (Built-in issue tracker) EnableTimeTracker bool `json:"enable_time_tracker"` // Let only contributors track time (Built-in issue tracker) AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"` // Enable dependencies for issues and pull requests (Built-in issue tracker) EnableIssueDependencies bool `json:"enable_issue_dependencies"` }
InternalTracker represents settings for internal tracker swagger:model
type Issue ¶ added in v1.9.0
type Issue struct { ID int64 `json:"id"` URL string `json:"url"` HTMLURL string `json:"html_url"` Index int64 `json:"number"` Poster *User `json:"user"` OriginalAuthor string `json:"original_author"` OriginalAuthorID int64 `json:"original_author_id"` Title string `json:"title"` Body string `json:"body"` Ref string `json:"ref"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` // deprecated Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` // Whether the issue is open or closed // // type: string // enum: open,closed State StateType `json:"state"` IsLocked bool `json:"is_locked"` Comments int `json:"comments"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` // swagger:strfmt date-time Closed *time.Time `json:"closed_at"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` PullRequest *PullRequestMeta `json:"pull_request"` Repo *RepositoryMeta `json:"repository"` }
Issue represents an issue in a repository swagger:model
type IssueCommentPayload ¶ added in v1.9.0
type IssueCommentPayload struct { Action HookIssueCommentAction `json:"action"` Issue *Issue `json:"issue"` Comment *Comment `json:"comment"` Changes *ChangesPayload `json:"changes,omitempty"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` IsPull bool `json:"is_pull"` }
IssueCommentPayload represents a payload information of issue comment event.
func (*IssueCommentPayload) JSONPayload ¶ added in v1.9.0
func (p *IssueCommentPayload) JSONPayload() ([]byte, error)
JSONPayload implements Payload
type IssueDeadline ¶ added in v1.9.0
IssueDeadline represents an issue deadline swagger:model
type IssueFormField ¶ added in v1.17.4
type IssueFormField struct { Type IssueFormFieldType `json:"type" yaml:"type"` ID string `json:"id" yaml:"id"` Attributes map[string]interface{} `json:"attributes" yaml:"attributes"` Validations map[string]interface{} `json:"validations" yaml:"validations"` }
IssueFormField represents a form field swagger:model
type IssueFormFieldType ¶ added in v1.17.4
type IssueFormFieldType string
IssueFormFieldType defines issue form field type, can be "markdown", "textarea", "input", "dropdown" or "checkboxes"
const ( IssueFormFieldTypeMarkdown IssueFormFieldType = "markdown" IssueFormFieldTypeTextarea IssueFormFieldType = "textarea" IssueFormFieldTypeInput IssueFormFieldType = "input" IssueFormFieldTypeDropdown IssueFormFieldType = "dropdown" IssueFormFieldTypeCheckboxes IssueFormFieldType = "checkboxes" )
type IssueLabelsOption ¶ added in v1.9.0
type IssueLabelsOption struct { // list of label IDs Labels []int64 `json:"labels"` }
IssueLabelsOption a collection of labels
type IssuePayload ¶ added in v1.9.0
type IssuePayload struct { Action HookIssueAction `json:"action"` Index int64 `json:"number"` Changes *ChangesPayload `json:"changes,omitempty"` Issue *Issue `json:"issue"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` }
IssuePayload represents the payload information that is sent along with an issue event.
func (*IssuePayload) JSONPayload ¶ added in v1.9.0
func (p *IssuePayload) JSONPayload() ([]byte, error)
JSONPayload encodes the IssuePayload to JSON, with an indentation of two spaces.
type IssueTemplate ¶ added in v1.13.0
type IssueTemplate struct { Name string `json:"name" yaml:"name"` Title string `json:"title" yaml:"title"` About string `json:"about" yaml:"about"` // Using "description" in a template file is compatible Labels IssueTemplateLabels `json:"labels" yaml:"labels"` Ref string `json:"ref" yaml:"ref"` Content string `json:"content" yaml:"-"` Fields []*IssueFormField `json:"body" yaml:"body"` FileName string `json:"file_name" yaml:"-"` }
IssueTemplate represents an issue template for a repository swagger:model
func (IssueTemplate) Type ¶ added in v1.17.4
func (it IssueTemplate) Type() IssueTemplateType
Type returns the type of IssueTemplate, can be "md", "yaml" or empty for known
type IssueTemplateLabels ¶ added in v1.17.4
type IssueTemplateLabels []string
func (*IssueTemplateLabels) UnmarshalYAML ¶ added in v1.17.4
func (l *IssueTemplateLabels) UnmarshalYAML(value *yaml.Node) error
type IssueTemplateType ¶ added in v1.17.4
type IssueTemplateType string
IssueTemplateType defines issue template type
const ( IssueTemplateTypeMarkdown IssueTemplateType = "md" IssueTemplateTypeYaml IssueTemplateType = "yaml" )
type LFSLock ¶ added in v1.9.0
type LFSLock struct { ID string `json:"id"` Path string `json:"path"` LockedAt time.Time `json:"locked_at"` Owner *LFSLockOwner `json:"owner"` }
LFSLock represent a lock for use with the locks API.
type LFSLockDeleteRequest ¶ added in v1.9.0
type LFSLockDeleteRequest struct {
Force bool `json:"force"`
}
LFSLockDeleteRequest contains params of a delete request https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock
type LFSLockError ¶ added in v1.9.0
type LFSLockError struct { Message string `json:"message"` Lock *LFSLock `json:"lock,omitempty"` Documentation string `json:"documentation_url,omitempty"` RequestID string `json:"request_id,omitempty"` }
LFSLockError contains information on the error that occurs
type LFSLockList ¶ added in v1.9.0
type LFSLockList struct { Locks []*LFSLock `json:"locks"` Next string `json:"next_cursor,omitempty"` }
LFSLockList represent a list of lock requested https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks
type LFSLockListVerify ¶ added in v1.9.0
type LFSLockListVerify struct { Ours []*LFSLock `json:"ours"` Theirs []*LFSLock `json:"theirs"` Next string `json:"next_cursor,omitempty"` }
LFSLockListVerify represent a list of lock verification requested https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification
type LFSLockOwner ¶ added in v1.9.0
type LFSLockOwner struct {
Name string `json:"name"`
}
LFSLockOwner represent a lock owner for use with the locks API.
type LFSLockRequest ¶ added in v1.9.0
type LFSLockRequest struct {
Path string `json:"path"`
}
LFSLockRequest contains the path of the lock to create https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
type LFSLockResponse ¶ added in v1.9.0
type LFSLockResponse struct {
Lock *LFSLock `json:"lock"`
}
LFSLockResponse represent a lock created https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
type Label ¶ added in v1.9.0
type Label struct { ID int64 `json:"id"` Name string `json:"name"` // example: 00aabb Color string `json:"color"` Description string `json:"description"` URL string `json:"url"` }
Label a label to an issue or a pr swagger:model
type ListPullRequestsOptions ¶ added in v1.9.0
ListPullRequestsOptions options for listing pull requests
type MarkdownOption ¶ added in v1.9.0
type MarkdownOption struct { // Text markdown to render // // in: body Text string // Mode to render // // in: body Mode string // Context to render // // in: body Context string // Is it a wiki page ? // // in: body Wiki bool }
MarkdownOption markdown options
type MarkdownRender ¶ added in v1.9.0
type MarkdownRender string
MarkdownRender is a rendered markdown document swagger:response MarkdownRender
type MigrateRepoOptions ¶ added in v1.13.0
type MigrateRepoOptions struct { // required: true CloneAddr string `json:"clone_addr" binding:"Required"` // deprecated (only for backwards compatibility) RepoOwnerID int64 `json:"uid"` // Name of User or Organisation who will own Repo after migration RepoOwner string `json:"repo_owner"` // required: true RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` // enum: git,github,gitea,gitlab Service string `json:"service"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` AuthToken string `json:"auth_token"` Mirror bool `json:"mirror"` LFS bool `json:"lfs"` LFSEndpoint string `json:"lfs_endpoint"` Private bool `json:"private"` Description string `json:"description" binding:"MaxSize(2048)"` Wiki bool `json:"wiki"` Milestones bool `json:"milestones"` Labels bool `json:"labels"` Issues bool `json:"issues"` PullRequests bool `json:"pull_requests"` Releases bool `json:"releases"` MirrorInterval string `json:"mirror_interval"` }
MigrateRepoOptions options for migrating repository's this is used to interact with api v1
type Milestone ¶ added in v1.9.0
type Milestone struct { ID int64 `json:"id"` Title string `json:"title"` Description string `json:"description"` State StateType `json:"state"` OpenIssues int `json:"open_issues"` ClosedIssues int `json:"closed_issues"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated *time.Time `json:"updated_at"` // swagger:strfmt date-time Closed *time.Time `json:"closed_at"` // swagger:strfmt date-time Deadline *time.Time `json:"due_on"` }
Milestone milestone is a collection of issues on one repository
type NodeInfo ¶ added in v1.16.0
type NodeInfo struct { Version string `json:"version"` Software NodeInfoSoftware `json:"software"` Protocols []string `json:"protocols"` Services NodeInfoServices `json:"services"` OpenRegistrations bool `json:"openRegistrations"` Usage NodeInfoUsage `json:"usage"` Metadata struct{} `json:"metadata"` }
NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks
type NodeInfoServices ¶ added in v1.16.0
type NodeInfoServices struct { Inbound []string `json:"inbound"` Outbound []string `json:"outbound"` }
NodeInfoServices contains the third party sites this server can connect to via their application API
type NodeInfoSoftware ¶ added in v1.16.0
type NodeInfoSoftware struct { Name string `json:"name"` Version string `json:"version"` Repository string `json:"repository"` Homepage string `json:"homepage"` }
NodeInfoSoftware contains Metadata about server software in use
type NodeInfoUsage ¶ added in v1.16.0
type NodeInfoUsage struct { Users NodeInfoUsageUsers `json:"users"` LocalPosts int `json:"localPosts,omitempty"` LocalComments int `json:"localComments,omitempty"` }
NodeInfoUsage contains usage statistics for this server
type NodeInfoUsageUsers ¶ added in v1.16.0
type NodeInfoUsageUsers struct { Total int `json:"total,omitempty"` ActiveHalfyear int `json:"activeHalfyear,omitempty"` ActiveMonth int `json:"activeMonth,omitempty"` }
NodeInfoUsageUsers contains statistics about the users of this server
type NotificationCount ¶ added in v1.12.0
type NotificationCount struct {
New int64 `json:"new"`
}
NotificationCount number of unread notifications
type NotificationSubject ¶ added in v1.12.0
type NotificationSubject struct { Title string `json:"title"` URL string `json:"url"` LatestCommentURL string `json:"latest_comment_url"` HTMLURL string `json:"html_url"` LatestCommentHTMLURL string `json:"latest_comment_html_url"` Type NotifySubjectType `json:"type" binding:"In(Issue,Pull,Commit,Repository)"` State StateType `json:"state"` }
NotificationSubject contains the notification subject (Issue/Pull/Commit)
type NotificationThread ¶ added in v1.12.0
type NotificationThread struct { ID int64 `json:"id"` Repository *Repository `json:"repository"` Subject *NotificationSubject `json:"subject"` Unread bool `json:"unread"` Pinned bool `json:"pinned"` UpdatedAt time.Time `json:"updated_at"` URL string `json:"url"` }
NotificationThread expose Notification on API
type NotifySubjectType ¶ added in v1.15.0
type NotifySubjectType string
NotifySubjectType represent type of notification subject
const ( // NotifySubjectIssue an issue is subject of an notification NotifySubjectIssue NotifySubjectType = "Issue" // NotifySubjectPull an pull is subject of an notification NotifySubjectPull NotifySubjectType = "Pull" // NotifySubjectCommit an commit is subject of an notification NotifySubjectCommit NotifySubjectType = "Commit" // NotifySubjectRepository an repository is subject of an notification NotifySubjectRepository NotifySubjectType = "Repository" )
type OAuth2Application ¶ added in v1.12.0
type OAuth2Application struct { ID int64 `json:"id"` Name string `json:"name"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` ConfidentialClient bool `json:"confidential_client"` RedirectURIs []string `json:"redirect_uris"` Created time.Time `json:"created"` }
OAuth2Application represents an OAuth2 application. swagger:response OAuth2Application
type OAuth2ApplicationList ¶ added in v1.12.0
type OAuth2ApplicationList []*OAuth2Application
OAuth2ApplicationList represents a list of OAuth2 applications. swagger:response OAuth2ApplicationList
type Organization ¶ added in v1.9.0
type Organization struct { ID int64 `json:"id"` Name string `json:"name"` FullName string `json:"full_name"` AvatarURL string `json:"avatar_url"` Description string `json:"description"` Website string `json:"website"` Location string `json:"location"` Visibility string `json:"visibility"` RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"` // deprecated UserName string `json:"username"` }
Organization represents an organization
type OrganizationPermissions ¶ added in v1.16.0
type OrganizationPermissions struct { IsOwner bool `json:"is_owner"` IsAdmin bool `json:"is_admin"` CanWrite bool `json:"can_write"` CanRead bool `json:"can_read"` CanCreateRepository bool `json:"can_create_repository"` }
OrganizationPermissions list different users permissions on an organization
type PRBranchInfo ¶ added in v1.9.0
type PRBranchInfo struct { Name string `json:"label"` Ref string `json:"ref"` Sha string `json:"sha"` RepoID int64 `json:"repo_id"` Repository *Repository `json:"repo"` }
PRBranchInfo information about a branch
type Package ¶ added in v1.17.0
type Package struct { ID int64 `json:"id"` Owner *User `json:"owner"` Repository *Repository `json:"repository"` Creator *User `json:"creator"` Type string `json:"type"` Name string `json:"name"` Version string `json:"version"` // swagger:strfmt date-time CreatedAt time.Time `json:"created_at"` }
Package represents a package
type PackageFile ¶ added in v1.17.0
type PackageFile struct { ID int64 `json:"id"` Size int64 Name string `json:"name"` HashMD5 string `json:"md5"` HashSHA1 string `json:"sha1"` HashSHA256 string `json:"sha256"` HashSHA512 string `json:"sha512"` }
PackageFile represents a package file
type PackagePayload ¶ added in v1.17.0
type PackagePayload struct { Action HookPackageAction `json:"action"` Repository *Repository `json:"repository"` Package *Package `json:"package"` Organization *User `json:"organization"` Sender *User `json:"sender"` }
PackagePayload represents a package payload
func (*PackagePayload) JSONPayload ¶ added in v1.17.0
func (p *PackagePayload) JSONPayload() ([]byte, error)
JSONPayload implements Payload
type PayloadCommit ¶ added in v1.9.0
type PayloadCommit struct { // sha1 hash of the commit ID string `json:"id"` Message string `json:"message"` URL string `json:"url"` Author *PayloadUser `json:"author"` Committer *PayloadUser `json:"committer"` Verification *PayloadCommitVerification `json:"verification"` // swagger:strfmt date-time Timestamp time.Time `json:"timestamp"` Added []string `json:"added"` Removed []string `json:"removed"` Modified []string `json:"modified"` }
PayloadCommit represents a commit
type PayloadCommitVerification ¶ added in v1.9.0
type PayloadCommitVerification struct { Verified bool `json:"verified"` Reason string `json:"reason"` Signature string `json:"signature"` Signer *PayloadUser `json:"signer"` Payload string `json:"payload"` }
PayloadCommitVerification represents the GPG verification of a commit
type PayloadUser ¶ added in v1.9.0
type PayloadUser struct { // Full name of the commit author Name string `json:"name"` // swagger:strfmt email Email string `json:"email"` UserName string `json:"username"` }
PayloadUser represents the author or committer of a commit
type Permission ¶ added in v1.9.0
type Permission struct { Admin bool `json:"admin"` Push bool `json:"push"` Pull bool `json:"pull"` }
Permission represents a set of permissions
type PublicKey ¶ added in v1.9.0
type PublicKey struct { ID int64 `json:"id"` Key string `json:"key"` URL string `json:"url,omitempty"` Title string `json:"title,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` // swagger:strfmt date-time Created time.Time `json:"created_at,omitempty"` Owner *User `json:"user,omitempty"` ReadOnly bool `json:"read_only,omitempty"` KeyType string `json:"key_type,omitempty"` }
PublicKey publickey is a user key to push code to repository
type PullRequest ¶ added in v1.9.0
type PullRequest struct { ID int64 `json:"id"` URL string `json:"url"` Index int64 `json:"number"` Poster *User `json:"user"` Title string `json:"title"` Body string `json:"body"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` State StateType `json:"state"` IsLocked bool `json:"is_locked"` Comments int `json:"comments"` HTMLURL string `json:"html_url"` DiffURL string `json:"diff_url"` PatchURL string `json:"patch_url"` Mergeable bool `json:"mergeable"` HasMerged bool `json:"merged"` // swagger:strfmt date-time Merged *time.Time `json:"merged_at"` MergedCommitID *string `json:"merge_commit_sha"` MergedBy *User `json:"merged_by"` AllowMaintainerEdit bool `json:"allow_maintainer_edit"` Base *PRBranchInfo `json:"base"` Head *PRBranchInfo `json:"head"` MergeBase string `json:"merge_base"` // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` // swagger:strfmt date-time Created *time.Time `json:"created_at"` // swagger:strfmt date-time Updated *time.Time `json:"updated_at"` // swagger:strfmt date-time Closed *time.Time `json:"closed_at"` }
PullRequest represents a pull request
type PullRequestMeta ¶ added in v1.9.0
PullRequestMeta PR info if an issue is a PR
type PullRequestPayload ¶ added in v1.9.0
type PullRequestPayload struct { Action HookIssueAction `json:"action"` Index int64 `json:"number"` Changes *ChangesPayload `json:"changes,omitempty"` PullRequest *PullRequest `json:"pull_request"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` Review *ReviewPayload `json:"review"` }
PullRequestPayload represents a payload information of pull request event.
func (*PullRequestPayload) JSONPayload ¶ added in v1.9.0
func (p *PullRequestPayload) JSONPayload() ([]byte, error)
JSONPayload FIXME
type PullReview ¶ added in v1.12.0
type PullReview struct { ID int64 `json:"id"` Reviewer *User `json:"user"` ReviewerTeam *Team `json:"team"` State ReviewStateType `json:"state"` Body string `json:"body"` CommitID string `json:"commit_id"` Stale bool `json:"stale"` Official bool `json:"official"` Dismissed bool `json:"dismissed"` CodeCommentsCount int `json:"comments_count"` // swagger:strfmt date-time Submitted time.Time `json:"submitted_at"` HTMLURL string `json:"html_url"` HTMLPullURL string `json:"pull_request_url"` }
PullReview represents a pull request review
type PullReviewComment ¶ added in v1.12.0
type PullReviewComment struct { ID int64 `json:"id"` Body string `json:"body"` Poster *User `json:"user"` Resolver *User `json:"resolver"` ReviewID int64 `json:"pull_request_review_id"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` Path string `json:"path"` CommitID string `json:"commit_id"` OrigCommitID string `json:"original_commit_id"` DiffHunk string `json:"diff_hunk"` LineNum uint64 `json:"position"` OldLineNum uint64 `json:"original_position"` HTMLURL string `json:"html_url"` HTMLPullURL string `json:"pull_request_url"` }
PullReviewComment represents a comment on a pull request review
type PullReviewRequestOptions ¶ added in v1.14.0
type PullReviewRequestOptions struct { Reviewers []string `json:"reviewers"` TeamReviewers []string `json:"team_reviewers"` }
PullReviewRequestOptions are options to add or remove pull review requests
type PushMirror ¶ added in v1.17.4
type PushMirror struct { RepoName string `json:"repo_name"` RemoteName string `json:"remote_name"` RemoteAddress string `json:"remote_address"` CreatedUnix string `json:"created"` LastUpdateUnix string `json:"last_update"` LastError string `json:"last_error"` Interval string `json:"interval"` }
PushMirror represents information of a push mirror swagger:model
type PushPayload ¶ added in v1.9.0
type PushPayload struct { Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` CompareURL string `json:"compare_url"` Commits []*PayloadCommit `json:"commits"` TotalCommits int `json:"total_commits"` HeadCommit *PayloadCommit `json:"head_commit"` Repo *Repository `json:"repository"` Pusher *User `json:"pusher"` Sender *User `json:"sender"` }
PushPayload represents a payload information of push event.
func ParsePushHook ¶ added in v1.9.0
func ParsePushHook(raw []byte) (*PushPayload, error)
ParsePushHook parses push event hook content.
func (*PushPayload) Branch ¶ added in v1.9.0
func (p *PushPayload) Branch() string
Branch returns branch name from a payload
func (*PushPayload) JSONPayload ¶ added in v1.9.0
func (p *PushPayload) JSONPayload() ([]byte, error)
JSONPayload FIXME
type PusherType ¶ added in v1.9.0
type PusherType string
PusherType define the type to push
const (
PusherTypeUser PusherType = "user"
)
describe all the PusherTypes
type Reaction ¶ added in v1.11.0
type Reaction struct { User *User `json:"user"` Reaction string `json:"content"` // swagger:strfmt date-time Created time.Time `json:"created_at"` }
Reaction contain one reaction
type Reference ¶ added in v1.9.0
type Reference struct { Ref string `json:"ref"` URL string `json:"url"` Object *GitObject `json:"object"` }
Reference represents a Git reference.
type Release ¶ added in v1.9.0
type Release struct { ID int64 `json:"id"` TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` URL string `json:"url"` HTMLURL string `json:"html_url"` TarURL string `json:"tarball_url"` ZipURL string `json:"zipball_url"` IsDraft bool `json:"draft"` IsPrerelease bool `json:"prerelease"` // swagger:strfmt date-time CreatedAt time.Time `json:"created_at"` // swagger:strfmt date-time PublishedAt time.Time `json:"published_at"` Publisher *User `json:"author"` Attachments []*Attachment `json:"assets"` }
Release represents a repository release
type ReleasePayload ¶ added in v1.9.0
type ReleasePayload struct { Action HookReleaseAction `json:"action"` Release *Release `json:"release"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` }
ReleasePayload represents a payload information of release event.
func (*ReleasePayload) JSONPayload ¶ added in v1.9.0
func (p *ReleasePayload) JSONPayload() ([]byte, error)
JSONPayload implements Payload
type RepoCollaboratorPermission ¶ added in v1.17.0
type RepoCollaboratorPermission struct { Permission string `json:"permission"` RoleName string `json:"role_name"` User *User `json:"user"` }
RepoCollaboratorPermission to get repository permission for a collaborator
type RepoCommit ¶ added in v1.9.0
type RepoCommit struct { URL string `json:"url"` Author *CommitUser `json:"author"` Committer *CommitUser `json:"committer"` Message string `json:"message"` Tree *CommitMeta `json:"tree"` Verification *PayloadCommitVerification `json:"verification"` }
RepoCommit contains information of a commit in the context of a repository.
type RepoTopicOptions ¶ added in v1.10.0
type RepoTopicOptions struct { // list of topic names Topics []string `json:"topics"` }
RepoTopicOptions a collection of repo topic names
type RepoTransfer ¶ added in v1.16.0
type RepoTransfer struct { Doer *User `json:"doer"` Recipient *User `json:"recipient"` Teams []*Team `json:"teams"` }
RepoTransfer represents a pending repo transfer
type Repository ¶ added in v1.9.0
type Repository struct { ID int64 `json:"id"` Owner *User `json:"owner"` Name string `json:"name"` FullName string `json:"full_name"` Description string `json:"description"` Empty bool `json:"empty"` Private bool `json:"private"` Fork bool `json:"fork"` Template bool `json:"template"` Parent *Repository `json:"parent"` Mirror bool `json:"mirror"` Size int `json:"size"` Language string `json:"language"` LanguagesURL string `json:"languages_url"` HTMLURL string `json:"html_url"` SSHURL string `json:"ssh_url"` CloneURL string `json:"clone_url"` OriginalURL string `json:"original_url"` Website string `json:"website"` Stars int `json:"stars_count"` Forks int `json:"forks_count"` Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` OpenPulls int `json:"open_pr_counter"` Releases int `json:"release_counter"` DefaultBranch string `json:"default_branch"` Archived bool `json:"archived"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` Permissions *Permission `json:"permissions,omitempty"` HasIssues bool `json:"has_issues"` InternalTracker *InternalTracker `json:"internal_tracker,omitempty"` ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"` HasWiki bool `json:"has_wiki"` ExternalWiki *ExternalWiki `json:"external_wiki,omitempty"` HasPullRequests bool `json:"has_pull_requests"` HasProjects bool `json:"has_projects"` IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"` AllowMerge bool `json:"allow_merge_commits"` AllowRebase bool `json:"allow_rebase"` AllowRebaseMerge bool `json:"allow_rebase_explicit"` AllowSquash bool `json:"allow_squash_merge"` AllowRebaseUpdate bool `json:"allow_rebase_update"` DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge"` DefaultMergeStyle string `json:"default_merge_style"` AvatarURL string `json:"avatar_url"` Internal bool `json:"internal"` MirrorInterval string `json:"mirror_interval"` // swagger:strfmt date-time MirrorUpdated time.Time `json:"mirror_updated,omitempty"` RepoTransfer *RepoTransfer `json:"repo_transfer"` }
Repository represents a repository
type RepositoryMeta ¶ added in v1.11.0
type RepositoryMeta struct { ID int64 `json:"id"` Name string `json:"name"` Owner string `json:"owner"` FullName string `json:"full_name"` }
RepositoryMeta basic repository information
type RepositoryPayload ¶ added in v1.9.0
type RepositoryPayload struct { Action HookRepoAction `json:"action"` Repository *Repository `json:"repository"` Organization *User `json:"organization"` Sender *User `json:"sender"` }
RepositoryPayload payload for repository webhooks
func (*RepositoryPayload) JSONPayload ¶ added in v1.9.0
func (p *RepositoryPayload) JSONPayload() ([]byte, error)
JSONPayload JSON representation of the payload
type ReviewPayload ¶ added in v1.11.0
ReviewPayload FIXME
type ReviewStateType ¶ added in v1.12.0
type ReviewStateType string
ReviewStateType review state type
const ( // ReviewStateApproved pr is approved ReviewStateApproved ReviewStateType = "APPROVED" // ReviewStatePending pr state is pending ReviewStatePending ReviewStateType = "PENDING" // ReviewStateComment is a comment review ReviewStateComment ReviewStateType = "COMMENT" // ReviewStateRequestChanges changes for pr are requested ReviewStateRequestChanges ReviewStateType = "REQUEST_CHANGES" // ReviewStateRequestReview review is requested from user ReviewStateRequestReview ReviewStateType = "REQUEST_REVIEW" // ReviewStateUnknown state of pr is unknown ReviewStateUnknown ReviewStateType = "" )
type SearchError ¶ added in v1.9.0
SearchError error of a failed search
type SearchResults ¶ added in v1.9.0
type SearchResults struct { OK bool `json:"ok"` Data []*Repository `json:"data"` }
SearchResults results of a successful search
type ServerVersion ¶ added in v1.9.0
type ServerVersion struct {
Version string `json:"version"`
}
ServerVersion wraps the version of the server
type StopWatch ¶ added in v1.11.0
type StopWatch struct { // swagger:strfmt date-time Created time.Time `json:"created"` Seconds int64 `json:"seconds"` Duration string `json:"duration"` IssueIndex int64 `json:"issue_index"` IssueTitle string `json:"issue_title"` RepoOwnerName string `json:"repo_owner_name"` RepoName string `json:"repo_name"` }
StopWatch represent a running stopwatch
type StopWatches ¶ added in v1.11.0
type StopWatches []StopWatch
StopWatches represent a list of stopwatches
type SubmitPullReviewOptions ¶ added in v1.12.0
type SubmitPullReviewOptions struct { Event ReviewStateType `json:"event"` Body string `json:"body"` }
SubmitPullReviewOptions are options to submit a pending pull review
type Tag ¶ added in v1.9.0
type Tag struct { Name string `json:"name"` Message string `json:"message"` ID string `json:"id"` Commit *CommitMeta `json:"commit"` ZipballURL string `json:"zipball_url"` TarballURL string `json:"tarball_url"` }
Tag represents a repository tag
type TaskStatus ¶ added in v1.10.0
type TaskStatus int
TaskStatus defines task status
const ( TaskStatusQueue TaskStatus = iota // 0 task is queue TaskStatusRunning // 1 task is running TaskStatusStopped // 2 task is stopped TaskStatusFailed // 3 task is failed TaskStatusFinished // 4 task is finished )
enumerate all the kinds of task status
type TaskType ¶ added in v1.10.0
type TaskType int
TaskType defines task type
all kinds of task types
type Team ¶ added in v1.9.0
type Team struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Organization *Organization `json:"organization"` IncludesAllRepositories bool `json:"includes_all_repositories"` // enum: none,read,write,admin,owner Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"] // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions. Units []string `json:"units"` // example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"} UnitsMap map[string]string `json:"units_map"` CanCreateOrgRepo bool `json:"can_create_org_repo"` }
Team represents a team in an organization
type TimelineComment ¶ added in v1.16.0
type TimelineComment struct { ID int64 `json:"id"` Type string `json:"type"` HTMLURL string `json:"html_url"` PRURL string `json:"pull_request_url"` IssueURL string `json:"issue_url"` Poster *User `json:"user"` Body string `json:"body"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time Updated time.Time `json:"updated_at"` OldProjectID int64 `json:"old_project_id"` ProjectID int64 `json:"project_id"` OldMilestone *Milestone `json:"old_milestone"` Milestone *Milestone `json:"milestone"` TrackedTime *TrackedTime `json:"tracked_time"` OldTitle string `json:"old_title"` NewTitle string `json:"new_title"` OldRef string `json:"old_ref"` NewRef string `json:"new_ref"` RefIssue *Issue `json:"ref_issue"` RefComment *Comment `json:"ref_comment"` RefAction string `json:"ref_action"` // commit SHA where issue/PR was referenced RefCommitSHA string `json:"ref_commit_sha"` ReviewID int64 `json:"review_id"` Label *Label `json:"label"` Assignee *User `json:"assignee"` AssigneeTeam *Team `json:"assignee_team"` // whether the assignees were removed or added RemovedAssignee bool `json:"removed_assignee"` ResolveDoer *User `json:"resolve_doer"` DependentIssue *Issue `json:"dependent_issue"` }
TimelineComment represents a timeline comment (comment of any type) on a commit or issue
type TopicName ¶ added in v1.10.0
type TopicName struct {
TopicNames []string `json:"topics"`
}
TopicName a list of repo topic names
type TopicResponse ¶ added in v1.10.0
type TopicResponse struct { ID int64 `json:"id"` Name string `json:"topic_name"` RepoCount int `json:"repo_count"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
TopicResponse for returning topics
type TrackedTime ¶ added in v1.9.0
type TrackedTime struct { ID int64 `json:"id"` // swagger:strfmt date-time Created time.Time `json:"created"` // Time in seconds Time int64 `json:"time"` // deprecated (only for backwards compatibility) UserID int64 `json:"user_id"` UserName string `json:"user_name"` // deprecated (only for backwards compatibility) IssueID int64 `json:"issue_id"` Issue *Issue `json:"issue"` }
TrackedTime worked time for an issue / pr
type TrackedTimeList ¶ added in v1.11.0
type TrackedTimeList []*TrackedTime
TrackedTimeList represents a list of tracked times
type TransferRepoOption ¶ added in v1.12.0
type TransferRepoOption struct { // required: true NewOwner string `json:"new_owner"` // ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. TeamIDs *[]int64 `json:"team_ids"` }
TransferRepoOption options when transfer a repository's ownership swagger:model
type UpdateFileOptions ¶ added in v1.9.0
type UpdateFileOptions struct { DeleteFileOptions // content must be base64 encoded // required: true Content string `json:"content"` // from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL FromPath string `json:"from_path" binding:"MaxSize(500)"` }
UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
func (*UpdateFileOptions) Branch ¶ added in v1.17.0
func (o *UpdateFileOptions) Branch() string
Branch returns branch name
type User ¶ added in v1.9.0
type User struct { // the user's id ID int64 `json:"id"` // the user's username UserName string `json:"login"` // the user's authentication sign-in name. // default: empty LoginName string `json:"login_name"` // the user's full name FullName string `json:"full_name"` // swagger:strfmt email Email string `json:"email"` // URL to the user's avatar AvatarURL string `json:"avatar_url"` // User locale Language string `json:"language"` // Is the user an administrator IsAdmin bool `json:"is_admin"` // swagger:strfmt date-time LastLogin time.Time `json:"last_login,omitempty"` // swagger:strfmt date-time Created time.Time `json:"created,omitempty"` // Is user restricted Restricted bool `json:"restricted"` // Is user active IsActive bool `json:"active"` // Is user login prohibited ProhibitLogin bool `json:"prohibit_login"` // the user's location Location string `json:"location"` // the user's website Website string `json:"website"` // the user's description Description string `json:"description"` // User visibility level option: public, limited, private Visibility string `json:"visibility"` // user counts Followers int `json:"followers_count"` Following int `json:"following_count"` StarredRepos int `json:"starred_repos_count"` }
User represents a user swagger:model
func (User) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility
type UserSettings ¶ added in v1.15.0
type UserSettings struct { FullName string `json:"full_name"` Website string `json:"website"` Description string `json:"description"` Location string `json:"location"` Language string `json:"language"` Theme string `json:"theme"` DiffViewStyle string `json:"diff_view_style"` // Privacy HideEmail bool `json:"hide_email"` HideActivity bool `json:"hide_activity"` }
UserSettings represents user settings swagger:model
type UserSettingsOptions ¶ added in v1.15.0
type UserSettingsOptions struct { FullName *string `json:"full_name" binding:"MaxSize(100)"` Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"` Description *string `json:"description" binding:"MaxSize(255)"` Location *string `json:"location" binding:"MaxSize(50)"` Language *string `json:"language"` Theme *string `json:"theme"` DiffViewStyle *string `json:"diff_view_style"` // Privacy HideEmail *bool `json:"hide_email"` HideActivity *bool `json:"hide_activity"` }
UserSettingsOptions represents options to change user settings swagger:model
type VerifyGPGKeyOption ¶ added in v1.15.0
type VerifyGPGKeyOption struct { // An Signature for a GPG key token // // required: true KeyID string `json:"key_id" binding:"Required"` Signature string `json:"armored_signature" binding:"Required"` }
VerifyGPGKeyOption options verifies user GPG key
type VisibleType ¶
type VisibleType int
VisibleType defines the visibility (Organization only)
const ( // VisibleTypePublic Visible for everyone VisibleTypePublic VisibleType = iota // VisibleTypeLimited Visible for every connected user VisibleTypeLimited // VisibleTypePrivate Visible only for organization's members VisibleTypePrivate )
func (VisibleType) IsLimited ¶
func (vt VisibleType) IsLimited() bool
IsLimited returns true if VisibleType is limited
func (VisibleType) IsPrivate ¶
func (vt VisibleType) IsPrivate() bool
IsPrivate returns true if VisibleType is private
func (VisibleType) IsPublic ¶
func (vt VisibleType) IsPublic() bool
IsPublic returns true if VisibleType is public
func (VisibleType) String ¶ added in v1.9.0
func (vt VisibleType) String() string
VisibilityString provides the mode string of the visibility type (public, limited, private)
type WatchInfo ¶ added in v1.9.0
type WatchInfo struct { Subscribed bool `json:"subscribed"` Ignored bool `json:"ignored"` Reason interface{} `json:"reason"` CreatedAt time.Time `json:"created_at"` URL string `json:"url"` RepositoryURL string `json:"repository_url"` }
WatchInfo represents an API watch status of one repository
type WikiCommit ¶ added in v1.16.0
type WikiCommit struct { ID string `json:"sha"` Author *CommitUser `json:"author"` Committer *CommitUser `json:"commiter"` Message string `json:"message"` }
WikiCommit page commit/revision
type WikiCommitList ¶ added in v1.16.0
type WikiCommitList struct { WikiCommits []*WikiCommit `json:"commits"` Count int64 `json:"count"` }
WikiCommitList commit/revision list
type WikiPage ¶ added in v1.16.0
type WikiPage struct { *WikiPageMetaData // Page content, base64 encoded ContentBase64 string `json:"content_base64"` CommitCount int64 `json:"commit_count"` Sidebar string `json:"sidebar"` }
WikiPage a wiki page
type WikiPageMetaData ¶ added in v1.16.0
type WikiPageMetaData struct { Title string `json:"title"` HTMLURL string `json:"html_url"` SubURL string `json:"sub_url"` LastCommit *WikiCommit `json:"last_commit"` }
WikiPageMetaData wiki page meta information
type WikiPayload ¶ added in v1.17.4
type WikiPayload struct { Action HookWikiAction `json:"action"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` Page string `json:"page"` Comment string `json:"comment"` }
WikiPayload payload for repository webhooks
func (*WikiPayload) JSONPayload ¶ added in v1.17.4
func (p *WikiPayload) JSONPayload() ([]byte, error)
JSONPayload JSON representation of the payload
Source Files ¶
- activitypub.go
- admin_user.go
- attachment.go
- commit_status.go
- cron.go
- doc.go
- fork.go
- git_blob.go
- git_hook.go
- hook.go
- issue.go
- issue_comment.go
- issue_label.go
- issue_milestone.go
- issue_reaction.go
- issue_stopwatch.go
- issue_tracked_time.go
- lfs_lock.go
- mirror.go
- miscellaneous.go
- nodeinfo.go
- notifications.go
- org.go
- org_member.go
- org_team.go
- org_type.go
- package.go
- pull.go
- pull_review.go
- release.go
- repo.go
- repo_branch.go
- repo_collaborator.go
- repo_commit.go
- repo_file.go
- repo_key.go
- repo_note.go
- repo_refs.go
- repo_tag.go
- repo_topic.go
- repo_tree.go
- repo_watch.go
- repo_wiki.go
- settings.go
- status.go
- task.go
- user.go
- user_app.go
- user_email.go
- user_gpgkey.go
- user_key.go