Versions in this module Expand all Collapse all v1 v1.33.1 Nov 27, 2023 Changes in this version + const EmptyCommit + const SearchTimeFormat + var ErrNotAuthorized = errors.New("Not Authorized") + var ErrNotFound = errors.New("Not Found") + var ErrNotSupported = errors.New("Not Supported") + var ErrSignatureInvalid = errors.New("Invalid webhook signature") + var ErrUnknownEvent = errors.New("Unknown webhook event") + func ExpandRef(name, prefix string) string + func ExtractPullRequest(ref string) int + func IsBranch(ref string) bool + func IsHash(s string) bool + func IsPullRequest(ref string) bool + func IsTag(ref string) bool + func Join(owner, name string) string + func Split(s string) (owner, name string) + func TrimRef(ref string) string + func WithContext(parent context.Context, token *Token) context.Context + type Action int + const ActionClose + const ActionCreate + const ActionDelete + const ActionEdit + const ActionLabel + const ActionMerge + const ActionOpen + const ActionPrerelease + const ActionPublish + const ActionRelease + const ActionReopen + const ActionReviewReady + const ActionSync + const ActionUnknown + const ActionUnlabel + const ActionUnpublish + const ActionUpdate + func (a *Action) UnmarshalJSON(data []byte) error + func (a Action) MarshalJSON() ([]byte, error) + func (a Action) String() (s string) + type BranchHook struct + Action Action + Ref Reference + Repo Repository + Sender User + func (h *BranchHook) Repository() Repository + type BranchListOptions struct + PageListOptions ListOptions + SearchTerm string + type Change struct + Added bool + BlobID string + Deleted bool + Path string + PrevFilePath string + Renamed bool + Sha string + type Client struct + BaseURL *url.URL + Client *http.Client + Contents ContentService + Driver Driver + DumpResponse func(*http.Response, bool) ([]byte, error) + Git GitService + Issues IssueService + Linker Linker + Milestones MilestoneService + Organizations OrganizationService + PullRequests PullRequestService + Releases ReleaseService + Repositories RepositoryService + Reviews ReviewService + Users UserService + Webhooks WebhookService + func (c *Client) Do(ctx context.Context, in *Request) (*Response, error) + func (c *Client) Rate() Rate + func (c *Client) SetRate(rate Rate) + type Comment struct + Author User + Body string + Created time.Time + ID int + Updated time.Time + type CommentInput struct + Body string + type Commit struct + Author Signature + Committer Signature + Link string + Message string + Sha string + type CommitListOptions struct + Page int + Path string + Ref string + Size int + type Content struct + BlobID string + Data []byte + Path string + Sha string + type ContentInfo struct + BlobID string + Kind ContentKind + Path string + Sha string + type ContentKind int + const ContentKindDirectory + const ContentKindFile + const ContentKindGitlink + const ContentKindSymlink + const ContentKindUnsupported + func (k *ContentKind) UnmarshalJSON(data []byte) error + func (k ContentKind) MarshalJSON() ([]byte, error) + func (k ContentKind) String() string + type ContentParams struct + BlobID string + Branch string + Data []byte + Message string + Ref string + Sha string + Signature Signature + type ContentService interface + Create func(ctx context.Context, repo, path string, params *ContentParams) (*Response, error) + Delete func(ctx context.Context, repo, path string, params *ContentParams) (*Response, error) + Find func(ctx context.Context, repo, path, ref string) (*Content, *Response, error) + List func(ctx context.Context, repo, path, ref string, opts ListOptions) ([]*ContentInfo, *Response, error) + Update func(ctx context.Context, repo, path string, params *ContentParams) (*Response, error) + type CreateBranch = ReferenceInput + type DeployHook struct + Data interface{} + Desc string + Number int64 + Ref Reference + Repo Repository + Sender User + Target string + TargetURL string + Task string + func (h *DeployHook) Repository() Repository + type DeployStatus struct + Desc string + Environment string + EnvironmentURL string + Number int64 + State State + Target string + type Driver int + const DriverAzure + const DriverBitbucket + const DriverCoding + const DriverGitea + const DriverGitee + const DriverGithub + const DriverGitlab + const DriverGogs + const DriverHarness + const DriverStash + const DriverUnknown + func (d Driver) String() (s string) + type Email struct + Primary bool + Value string + Verified bool + type GitService interface + CompareChanges func(ctx context.Context, repo, source, target string, opts ListOptions) ([]*Change, *Response, error) + CreateBranch func(ctx context.Context, repo string, params *ReferenceInput) (*Response, error) + FindBranch func(ctx context.Context, repo, name string) (*Reference, *Response, error) + FindCommit func(ctx context.Context, repo, ref string) (*Commit, *Response, error) + FindTag func(ctx context.Context, repo, name string) (*Reference, *Response, error) + ListBranches func(ctx context.Context, repo string, opts ListOptions) ([]*Reference, *Response, error) + ListBranchesV2 func(ctx context.Context, repo string, opts BranchListOptions) ([]*Reference, *Response, error) + ListChanges func(ctx context.Context, repo, ref string, opts ListOptions) ([]*Change, *Response, error) + ListCommits func(ctx context.Context, repo string, opts CommitListOptions) ([]*Commit, *Response, error) + ListTags func(ctx context.Context, repo string, opts ListOptions) ([]*Reference, *Response, error) + type Hook struct + Active bool + Events []string + ID string + Name string + SkipVerify bool + Target string + type HookEvents struct + Branch bool + Deployment bool + Issue bool + IssueComment bool + PullRequest bool + PullRequestComment bool + Push bool + ReviewComment bool + Tag bool + type HookInput struct + Events HookEvents + Name string + NativeEvents []string + Secret string + SkipVerify bool + Target string + type Issue struct + Author User + Body string + Closed bool + Created time.Time + Labels []string + Link string + Locked bool + Number int + PullRequest PullRequest + Title string + Updated time.Time + type IssueCommentHook struct + Action Action + Comment Comment + Issue Issue + Repo Repository + Sender User + func (h *IssueCommentHook) Repository() Repository + type IssueHook struct + Action Action + Issue Issue + Repo Repository + Sender User + func (h *IssueHook) Repository() Repository + type IssueInput struct + Body string + Title string + type IssueListOptions struct + Closed bool + Open bool + Page int + Size int + type IssueService interface + Close func(context.Context, string, int) (*Response, error) + Create func(context.Context, string, *IssueInput) (*Issue, *Response, error) + CreateComment func(context.Context, string, int, *CommentInput) (*Comment, *Response, error) + DeleteComment func(context.Context, string, int, int) (*Response, error) + Find func(context.Context, string, int) (*Issue, *Response, error) + FindComment func(context.Context, string, int, int) (*Comment, *Response, error) + List func(context.Context, string, IssueListOptions) ([]*Issue, *Response, error) + ListComments func(context.Context, string, int, ListOptions) ([]*Comment, *Response, error) + Lock func(context.Context, string, int) (*Response, error) + Unlock func(context.Context, string, int) (*Response, error) + type Label struct + Color string + Name string + type Linker interface + Diff func(ctx context.Context, repo string, source, target Reference) (string, error) + Resource func(ctx context.Context, repo string, ref Reference) (string, error) + type ListOptions struct + Page int + Size int + URL string + type Membership struct + Active bool + Role Role + type Milestone struct + Description string + DueDate time.Time + ID int + Link string + Number int + State string + Title string + type MilestoneInput struct + Description string + DueDate time.Time + State string + Title string + type MilestoneListOptions struct + Closed bool + Open bool + Page int + Size int + type MilestoneService interface + Create func(context.Context, string, *MilestoneInput) (*Milestone, *Response, error) + Delete func(context.Context, string, int) (*Response, error) + Find func(context.Context, string, int) (*Milestone, *Response, error) + List func(context.Context, string, MilestoneListOptions) ([]*Milestone, *Response, error) + Update func(context.Context, string, int, *MilestoneInput) (*Milestone, *Response, error) + type Organization struct + Avatar string + Name string + type OrganizationService interface + Find func(ctx context.Context, name string) (*Organization, *Response, error) + FindMembership func(ctx context.Context, name, username string) (*Membership, *Response, error) + List func(ctx context.Context, opts ListOptions) ([]*Organization, *Response, error) + type Page struct + First int + Last int + Next int + NextURL string + Prev int + type Perm struct + Admin bool + Pull bool + Push bool + type PullRequest struct + Author User + Base Reference + Body string + Closed bool + Created time.Time + Diff string + Fork string + Head Reference + Labels []Label + Link string + Merge string + Merged bool + Number int + Ref string + Sha string + Source string + Target string + Title string + Updated time.Time + type PullRequestCommentHook struct + Action Action + Comment Comment + PullRequest PullRequest + Repo Repository + Sender User + func (h *PullRequestCommentHook) Repository() Repository + type PullRequestHook struct + Action Action + PullRequest PullRequest + Repo Repository + Sender User + func (h *PullRequestHook) Repository() Repository + type PullRequestInput struct + Body string + Source string + Target string + Title string + type PullRequestListOptions struct + Closed bool + Open bool + Page int + Size int + type PullRequestService interface + Close func(context.Context, string, int) (*Response, error) + Create func(context.Context, string, *PullRequestInput) (*PullRequest, *Response, error) + CreateComment func(context.Context, string, int, *CommentInput) (*Comment, *Response, error) + DeleteComment func(context.Context, string, int, int) (*Response, error) + Find func(context.Context, string, int) (*PullRequest, *Response, error) + FindComment func(context.Context, string, int, int) (*Comment, *Response, error) + List func(context.Context, string, PullRequestListOptions) ([]*PullRequest, *Response, error) + ListChanges func(context.Context, string, int, ListOptions) ([]*Change, *Response, error) + ListComments func(context.Context, string, int, ListOptions) ([]*Comment, *Response, error) + ListCommits func(context.Context, string, int, ListOptions) ([]*Commit, *Response, error) + Merge func(context.Context, string, int) (*Response, error) + type PushHook struct + After string + BaseRef string + Before string + Commit Commit + Commits []Commit + Ref string + Repo Repository + Sender User + func (h *PushHook) Repository() Repository + type Rate struct + Limit int + Remaining int + Reset int64 + type Reference struct + Name string + Path string + Sha string + type ReferenceInput struct + Name string + Sha string + type Release struct + Commitish string + Created time.Time + Description string + Draft bool + ID int + Link string + Prerelease bool + Published time.Time + Tag string + Title string + type ReleaseHook struct + Action Action + Release Release + Repo Repository + Sender User + func (h *ReleaseHook) Repository() Repository + type ReleaseInput struct + Commitish string + Description string + Draft bool + Prerelease bool + Tag string + Title string + type ReleaseListOptions struct + Closed bool + Open bool + Page int + Size int + type ReleaseService interface + Create func(context.Context, string, *ReleaseInput) (*Release, *Response, error) + Delete func(context.Context, string, int) (*Response, error) + DeleteByTag func(context.Context, string, string) (*Response, error) + Find func(context.Context, string, int) (*Release, *Response, error) + FindByTag func(context.Context, string, string) (*Release, *Response, error) + List func(context.Context, string, ReleaseListOptions) ([]*Release, *Response, error) + Update func(context.Context, string, int, *ReleaseInput) (*Release, *Response, error) + UpdateByTag func(context.Context, string, string, *ReleaseInput) (*Release, *Response, error) + type RepoListOptions struct + type RepoSearchTerm struct + RepoName string + User string + type Repository struct + Archived bool + Branch string + Clone string + CloneSSH string + Created time.Time + ID string + Link string + Name string + Namespace string + Perm *Perm + Private bool + Updated time.Time + Visibility Visibility + type RepositoryService interface + CreateHook func(context.Context, string, *HookInput) (*Hook, *Response, error) + CreateStatus func(context.Context, string, string, *StatusInput) (*Status, *Response, error) + DeleteHook func(context.Context, string, string) (*Response, error) + Find func(context.Context, string) (*Repository, *Response, error) + FindHook func(context.Context, string, string) (*Hook, *Response, error) + FindPerms func(context.Context, string) (*Perm, *Response, error) + List func(context.Context, ListOptions) ([]*Repository, *Response, error) + ListHooks func(context.Context, string, ListOptions) ([]*Hook, *Response, error) + ListStatus func(context.Context, string, string, ListOptions) ([]*Status, *Response, error) + ListV2 func(context.Context, RepoListOptions) ([]*Repository, *Response, error) + UpdateHook func(context.Context, string, string, *HookInput) (*Hook, *Response, error) + type Request struct + Body io.Reader + Header http.Header + Method string + Path string + type Response struct + Body io.ReadCloser + Header http.Header + ID string + Page Page + Rate Rate + Status int + type Review struct + Author User + Body string + Created time.Time + ID int + Line int + Link string + Path string + Sha string + Updated time.Time + type ReviewCommentHook struct + Action Action + PullRequest PullRequest + Repo Repository + Review Review + func (h *ReviewCommentHook) Repository() Repository + type ReviewInput struct + Body string + Line int + Path string + Sha string + type ReviewService interface + Create func(context.Context, string, int, *ReviewInput) (*Review, *Response, error) + Delete func(context.Context, string, int, int) (*Response, error) + Find func(context.Context, string, int, int) (*Review, *Response, error) + List func(context.Context, string, int, ListOptions) ([]*Review, *Response, error) + type Role int + const RoleAdmin + const RoleMember + const RoleUndefined + func (r Role) String() (s string) + type SecretFunc func(webhook Webhook) (string, error) + type Signature struct + Avatar string + Date time.Time + Email string + Login string + Name string + type State int + const StateCanceled + const StateError + const StateFailure + const StatePending + const StateRunning + const StateSuccess + const StateUnknown + type Status struct + Desc string + Label string + State State + Target string + Title string + type StatusInput struct + Desc string + Label string + State State + Target string + Title string + type TagHook struct + Action Action + Ref Reference + Repo Repository + Sender User + func (h *TagHook) Repository() Repository + type Token struct + Expires time.Time + Refresh string + Token string + type TokenKey struct + type TokenSource interface + Token func(context.Context) (*Token, error) + type User struct + Avatar string + Created time.Time + Email string + ID string + Login string + Name string + Updated time.Time + type UserService interface + Find func(context.Context) (*User, *Response, error) + FindEmail func(context.Context) (string, *Response, error) + FindLogin func(context.Context, string) (*User, *Response, error) + ListEmail func(context.Context, ListOptions) ([]*Email, *Response, error) + type Visibility int + const VisibilityInternal + const VisibilityPrivate + const VisibilityPublic + const VisibilityUndefined + func (v Visibility) String() (s string) + type Webhook interface + Repository func() Repository + type WebhookService interface + Parse func(req *http.Request, fn SecretFunc) (Webhook, error)