Versions in this module Expand all Collapse all v1 v1.2.5 Nov 14, 2020 v1.2.4 Nov 13, 2020 Changes in this version + type CommitAuthor struct + Date time.Time + Email string + Login *string + Name string v1.2.3 Nov 13, 2020 v1.2.2 Nov 13, 2020 v1.2.1 Nov 13, 2020 v1.2.0 Nov 13, 2020 v1.1.0 Nov 13, 2020 v1.0.0 Nov 13, 2020 Changes in this version + const Approve + const Comment + const DefaultAPIEndpoint + const DefaultGraphQLEndpoint + const DefaultHost + const EventGUID + const ImageSizeLimit + const OrgLogField + const PrLogField + const PrivacyClosed + const PrivacySecret + const PullRequestFileAdded + const PullRequestFileModified + const PullRequestFileRemoved + const PullRequestFileRenamed + const ReactionConfused + const ReactionHeart + const ReactionHooray + const ReactionLaugh + const ReactionThumbsDown + const ReactionThumbsUp + const RepoLogField + const RequestChanges + const ReviewStateApproved + const ReviewStateChangesRequested + const ReviewStateCommented + const ReviewStateDismissed + const ReviewStatePending + const RoleAdmin + const RoleAll + const RoleMaintainer + const RoleMember + const SearchTimeFormat + const StateActive + const StatePending + const StatusError + const StatusFailure + const StatusPending + const StatusSuccess + const UserTypeBot + const UserTypeUser + var AllHookEvents = []string + var FoundingYear = time.Parse(SearchTimeFormat, "2007-01-01T00:00:00Z") + var SecurityForkNameRE = regexp.MustCompile(`^[\w-]+-ghsa-[\w-]+$`) + func HasLabel(label string, issueLabels []Label) bool + func HasLabels(labels []string, issueLabels []Label) bool + func ImageTooBig(url string) (bool, error) + func IsNotFound(err error) bool + func NewNotFound() error + func NormLogin(login string) string + func PayloadSignature(payload []byte, key []byte) string + func ValidatePayload(payload []byte, sig string, tokenGenerator func() []byte) bool + func ValidateWebhook(w http.ResponseWriter, r *http.Request, tokenGenerator func() []byte) (string, string, []byte, bool, int) + type AlternativeClientError struct + DocumentationURL string + Errors []string + Message string + func (r AlternativeClientError) Error() string + type App struct + CreatedAt string + Description string + Events []string + ExternalURL string + HTMLURL string + ID int64 + Name string + NodeID string + Owner User + Permissions *InstallationPermissions + Slug string + UpdatedAt string + type Branch struct + Name string + Protected bool + type BranchProtection struct + EnforceAdmins EnforceAdmins + RequiredPullRequestReviews *RequiredPullRequestReviews + RequiredStatusChecks *RequiredStatusChecks + Restrictions *Restrictions + type BranchProtectionRequest struct + AllowDeletions bool + AllowForcePushes bool + EnforceAdmins *bool + RequiredLinearHistory bool + RequiredPullRequestReviews *RequiredPullRequestReviewsRequest + RequiredStatusChecks *RequiredStatusChecks + Restrictions *RestrictionsRequest + func (r BranchProtectionRequest) String() string + type CheckRun struct + App App + CheckSuite CheckSuite + CompletedAt string + Conclusion string + DetailsURL string + ExternalID string + HTMLURL string + HeadSHA string + ID int64 + Name string + NodeID string + Output CheckRunOutput + PullRequests []PullRequest + StartedAt string + Status string + URL string + type CheckRunAnnotation struct + AnnotationLevel string + EndColumn int + EndLine int + Message string + Path string + RawDetails string + StartColumn int + StartLine int + Title string + type CheckRunImage struct + Alt string + Caption string + ImageURL string + type CheckRunList struct + CheckRuns []CheckRun + Total int + type CheckRunOutput struct + Annotations []CheckRunAnnotation + AnnotationsCount int + AnnotationsURL string + Images []CheckRunImage + Summary string + Text string + Title string + type CheckSuite struct + AfterSHA string + App *App + BeforeSHA string + Conclusion string + HeadBranch string + HeadCommit *Commit + HeadSHA string + ID int64 + NodeID string + PullRequests []PullRequest + Repository *Repo + Status string + URL string + type Client interface + ForPlugin func(plugin string) Client + ForSubcomponent func(subcomponent string) Client + Query func(ctx context.Context, q interface{}, vars map[string]interface{}) error + SetMax404Retries func(int) + Throttle func(hourlyTokens, burst int) + WithFields func(fields logrus.Fields) Client + func NewClient(getToken func() []byte, censor func([]byte) []byte, graphqlEndpoint string, ...) Client + func NewClientWithFields(fields logrus.Fields, getToken func() []byte, censor func([]byte) []byte, ...) Client + func NewDryRunClient(getToken func() []byte, censor func([]byte) []byte, graphqlEndpoint string, ...) Client + func NewDryRunClientWithFields(fields logrus.Fields, getToken func() []byte, censor func([]byte) []byte, ...) Client + func NewFakeClient() Client + type ClientError struct + Errors []clientErrorSubError + Message string + func (r ClientError) Error() string + type CombinedStatus struct + SHA string + State string + Statuses []Status + type CommentClient interface + CreateComment func(org, repo string, number int, comment string) error + CreateCommentReaction func(org, repo string, id int, reaction string) error + DeleteComment func(org, repo string, id int) error + DeleteStaleComments func(org, repo string, number int, comments []IssueComment, ...) error + EditComment func(org, repo string, id int, comment string) error + type Commit struct + Added []string + Author User + Distinct bool + ID string + Message string + Modified []string + Removed []string + SHA string + URL string + type CommitClient interface + CreateStatus func(org, repo, SHA string, s Status) error + DeleteRef func(org, repo, ref string) error + GetCombinedStatus func(org, repo, ref string) (*CombinedStatus, error) + GetRef func(org, repo, ref string) (string, error) + GetSingleCommit func(org, repo, SHA string) (SingleCommit, error) + ListCheckRuns func(org, repo, ref string) (*CheckRunList, error) + ListStatuses func(org, repo, ref string) ([]Status, error) + type CommitFile struct + Additions int + BlobURL string + Changes int + ContentsURL string + Deletions int + Filename string + Patch string + PreviousFilename string + RawURL string + SHA string + Status string + type CommitStats struct + Additions int + Deletions int + Total int + type Content struct + Content string + SHA string + type DraftReview struct + Action ReviewAction + Body string + Comments []DraftReviewComment + CommitSHA string + type DraftReviewComment struct + Body string + Path string + Position int + type EnforceAdmins struct + Enabled bool + type ExtraUsers struct + Users []string + func (e ExtraUsers) Error() string + type FileNotFound struct + func (e *FileNotFound) Error() string + type FullRepo struct + AllowMergeCommit bool + AllowRebaseMerge bool + AllowSquashMerge bool + type GenericCommentEvent struct + Action GenericCommentEventAction + Assignees []User + Body string + CommentID *int + GUID string + HTMLURL string + ID int + IsPR bool + IssueAuthor User + IssueBody string + IssueHTMLURL string + IssueState string + IssueTitle string + Number int + Repo Repo + User User + type GenericCommentEventAction string + const GenericCommentActionCreated + const GenericCommentActionDeleted + const GenericCommentActionEdited + type GenericEvent struct + Org Organization + Repo Repo + Sender User + type GetRefResponse []GetRefResult + func (grr *GetRefResponse) RefNames() []string + func (grr *GetRefResponse) UnmarshalJSON(data []byte) error + type GetRefResult struct + NodeID string + Object struct{ ... } + Ref string + URL string + type GetRefTooManyResultsError struct + func (GetRefTooManyResultsError) Is(err error) bool + func (e GetRefTooManyResultsError) Error() string + type GitCommit struct + Author User + CommentCount int + Committer User + HTMLURL string + Message string + NodeID string + Parents []GitCommit + SHA string + Stats *CommitStats + Tree Tree + URL string + Verification *SignatureVerification + type HMACToken struct + CreatedAt time.Time + Value string + type HMACsForRepo []HMACToken + type Hook struct + Active bool + Config HookConfig + Events []string + ID int + Name string + type HookClient interface + CreateOrgHook func(org string, req HookRequest) (int, error) + CreateRepoHook func(org, repo string, req HookRequest) (int, error) + DeleteOrgHook func(org string, id int, req HookRequest) error + DeleteRepoHook func(org, repo string, id int, req HookRequest) error + EditOrgHook func(org string, id int, req HookRequest) error + EditRepoHook func(org, repo string, id int, req HookRequest) error + ListOrgHooks func(org string) ([]Hook, error) + ListRepoHooks func(org, repo string) ([]Hook, error) + type HookConfig struct + ContentType *string + Secret *string + URL string + type HookRequest struct + Active *bool + AddEvents []string + Config *HookConfig + Events []string + Name string + RemoveEvents []string + type InstallationPermissions struct + Administration string + Blocking string + Checks string + ContentReferences string + Contents string + Deployments string + Emails string + Followers string + Issues string + Members string + Metadata string + OrganizationAdministration string + OrganizationHooks string + OrganizationPlan string + OrganizationPreReceiveHooks string + OrganizationProjects string + OrganizationUserBlocking string + Packages string + Pages string + PullRequests string + RepositoryHooks string + RepositoryPreReceiveHooks string + RepositoryProjects string + SingleFile string + Statuses string + TeamDiscussions string + VulnerabilityAlerts string + type Issue struct + Assignees []User + Body string + CreatedAt time.Time + HTMLURL string + ID int + Labels []Label + Milestone Milestone + Number int + PullRequest *struct{} + State string + Title string + UpdatedAt time.Time + User User + func (i Issue) HasLabel(labelToFind string) bool + func (i Issue) IsAssignee(login string) bool + func (i Issue) IsAuthor(login string) bool + func (i Issue) IsPullRequest() bool + type IssueClient interface + AssignIssue func(org, repo string, number int, logins []string) error + CloseIssue func(org, repo string, number int) error + CreateIssue func(org, repo, title, body string, milestone int, labels, assignees []string) (int, error) + CreateIssueReaction func(org, repo string, id int, reaction string) error + EditIssue func(org, repo string, number int, issue *Issue) (*Issue, error) + FindIssues func(query, sort string, asc bool) ([]Issue, error) + GetIssue func(org, repo string, number int) (*Issue, error) + GetIssueLabels func(org, repo string, number int) ([]Label, error) + ListIssueComments func(org, repo string, number int) ([]IssueComment, error) + ListIssueEvents func(org, repo string, num int) ([]ListedIssueEvent, error) + ListOpenIssues func(org, repo string) ([]Issue, error) + ReopenIssue func(org, repo string, number int) error + UnassignIssue func(org, repo string, number int, logins []string) error + type IssueComment struct + Body string + CreatedAt time.Time + HTMLURL string + ID int + UpdatedAt time.Time + User User + type IssueCommentEvent struct + Action IssueCommentEventAction + Comment IssueComment + GUID string + Issue Issue + Repo Repo + type IssueCommentEventAction string + const IssueCommentActionCreated + const IssueCommentActionDeleted + const IssueCommentActionEdited + type IssueEvent struct + Action IssueEventAction + GUID string + Issue Issue + Label Label + Repo Repo + type IssueEventAction string + const IssueActionAssigned + const IssueActionClosed + const IssueActionDeleted + const IssueActionDemilestoned + const IssueActionEdited + const IssueActionLabeled + const IssueActionLocked + const IssueActionMilestoned + const IssueActionOpened + const IssueActionPinned + const IssueActionReopened + const IssueActionTransferred + const IssueActionUnassigned + const IssueActionUnlabeled + const IssueActionUnlocked + const IssueActionUnpinned + type IssuesSearchResult struct + Issues []Issue + Total int + type Label struct + Color string + Description string + Name string + URL string + type ListedIssueEvent struct + Actor User + CreatedAt time.Time + Event IssueEventAction + Label Label + type Membership struct + Role string + State string + type MergeCommitsForbiddenError string + func (e MergeCommitsForbiddenError) Error() string + type MergeDetails struct + CommitMessage string + CommitTitle string + MergeMethod string + SHA string + type Milestone struct + Number int + Title string + type MilestoneClient interface + ClearMilestone func(org, repo string, num int) error + ListMilestones func(org, repo string) ([]Milestone, error) + SetMilestone func(org, repo string, issueNum, milestoneNum int) error + type MissingUsers struct + Users []string + func (m MissingUsers) Error() string + type ModifiedHeadError string + func (e ModifiedHeadError) Error() string + type OrgInvitation struct + Email string + Inviter TeamMember + type OrgMembership struct + type Organization struct + BillingEmail string + Company string + DefaultRepositoryPermission string + Description string + Email string + HasOrganizationProjects bool + HasRepositoryProjects bool + Location string + Login string + MembersCanCreateRepositories bool + Name string + type OrganizationClient interface + EditOrg func(name string, config Organization) (*Organization, error) + GetOrg func(name string) (*Organization, error) + GetUserPermission func(org, repo, user string) (string, error) + HasPermission func(org, repo, user string, roles ...string) (bool, error) + IsMember func(org, user string) (bool, error) + ListOrgInvitations func(org string) ([]OrgInvitation, error) + ListOrgMembers func(org, role string) ([]TeamMember, error) + RemoveOrgMembership func(org, user string) error + UpdateOrgMembership func(org, user string, admin bool) (*OrgMembership, error) + type Project struct + ID int + Name string + type ProjectCard struct + ContentID int + ContentType string + ContentURL string + ID int + type ProjectClient interface + CreateProjectCard func(columnID int, projectCard ProjectCard) (*ProjectCard, error) + DeleteProjectCard func(projectCardID int) error + GetColumnProjectCard func(columnID int, issueURL string) (*ProjectCard, error) + GetColumnProjectCards func(columnID int) ([]ProjectCard, error) + GetOrgProjects func(org string) ([]Project, error) + GetProjectColumns func(projectID int) ([]ProjectColumn, error) + GetRepoProjects func(owner, repo string) ([]Project, error) + MoveProjectCard func(projectCardID int, newColumnID int) error + type ProjectColumn struct + ID int + Name string + type PullRequest struct + Assignees []User + Base PullRequestBranch + Body string + Commits int + CreatedAt time.Time + Draft bool + HTMLURL string + Head PullRequestBranch + ID int + Labels []Label + Mergable *bool + MergeSHA *string + Merged bool + Milestone *Milestone + Number int + RequestedReviewers []User + State string + Title string + UpdatedAt time.Time + User User + type PullRequestBranch struct + Ref string + Repo Repo + SHA string + type PullRequestChange struct + Additions int + BlobURL string + Changes int + Deletions int + Filename string + Patch string + PreviousFilename string + SHA string + Status string + type PullRequestClient interface + ClosePR func(org, repo string, number int) error + CreatePullRequest func(org, repo, title, body, head, base string, canModify bool) (int, error) + CreateReview func(org, repo string, number int, r DraftReview) error + EditPullRequest func(org, repo string, number int, pr *PullRequest) (*PullRequest, error) + GetPullRequest func(org, repo string, number int) (*PullRequest, error) + GetPullRequestChanges func(org, repo string, number int) ([]PullRequestChange, error) + GetPullRequestPatch func(org, repo string, number int) ([]byte, error) + GetPullRequests func(org, repo string) ([]PullRequest, error) + IsMergeable func(org, repo string, number int, SHA string) (bool, error) + ListPRCommits func(org, repo string, number int) ([]RepositoryCommit, error) + ListPullRequestComments func(org, repo string, number int) ([]ReviewComment, error) + ListReviews func(org, repo string, number int) ([]Review, error) + Merge func(org, repo string, pr int, details MergeDetails) error + ReopenPR func(org, repo string, number int) error + RequestReview func(org, repo string, number int, logins []string) error + UnrequestReview func(org, repo string, number int, logins []string) error + UpdatePullRequest func(org, repo string, number int, title, body *string, open *bool, branch *string, ...) error + UpdatePullRequestBranch func(org, repo string, number int, expectedHeadSha *string) error + type PullRequestEvent struct + Action PullRequestEventAction + Changes json.RawMessage + GUID string + Label Label + Number int + PullRequest PullRequest + Repo Repo + Sender User + type PullRequestEventAction string + const PullRequestActionAssigned + const PullRequestActionClosed + const PullRequestActionConvertedToDraft + const PullRequestActionEdited + const PullRequestActionLabeled + const PullRequestActionLocked + const PullRequestActionOpened + const PullRequestActionReadyForReview + const PullRequestActionReopened + const PullRequestActionReviewRequestRemoved + const PullRequestActionReviewRequested + const PullRequestActionSynchronize + const PullRequestActionUnassigned + const PullRequestActionUnlabeled + const PullRequestActionUnlocked + type PullRequestFileStatus string + type PullRequestMergeType string + const MergeMerge + const MergeRebase + const MergeSquash + type PushEvent struct + After string + Before string + Commits []Commit + Compare string + Created bool + Deleted bool + Forced bool + GUID string + Pusher User + Ref string + Repo Repo + Sender User + func (pe PushEvent) Branch() string + type Reaction struct + Content string + type Repo struct + Archived bool + DefaultBranch string + Description string + Fork bool + FullName string + HTMLURL string + HasIssues bool + HasProjects bool + HasWiki bool + Homepage string + Name string + Owner User + Permissions RepoPermissions + Private bool + type RepoCreateRequest struct + AutoInit *bool + GitignoreTemplate *string + LicenseTemplate *string + type RepoPermissionLevel string + const Admin + const None + const Read + const Write + func LevelFromPermissions(permissions RepoPermissions) RepoPermissionLevel + func (l *RepoPermissionLevel) UnmarshalText(text []byte) error + func (l RepoPermissionLevel) MarshalText() ([]byte, error) + type RepoPermissions struct + Admin bool + Pull bool + Push bool + func PermissionsFromTeamPermission(permission TeamPermission) RepoPermissions + type RepoRequest struct + AllowMergeCommit *bool + AllowRebaseMerge *bool + AllowSquashMerge *bool + Description *string + HasIssues *bool + HasProjects *bool + HasWiki *bool + Homepage *string + Name *string + Private *bool + func (r RepoRequest) Defined() bool + func (r RepoRequest) ToRepo() *FullRepo + type RepoUpdateRequest struct + Archived *bool + DefaultBranch *string + func (r RepoUpdateRequest) Defined() bool + func (r RepoUpdateRequest) ToRepo() *FullRepo + type RepositoryClient interface + AddLabel func(org, repo string, number int, label string) error + AddRepoLabel func(org, repo, label, description, color string) error + CreateFork func(owner, repo string) (string, error) + CreateRepo func(owner string, isUser bool, repo RepoCreateRequest) (*FullRepo, error) + DeleteRepoLabel func(org, repo, label string) error + GetBranchProtection func(org, repo, branch string) (*BranchProtection, error) + GetBranches func(org, repo string, onlyProtected bool) ([]Branch, error) + GetFile func(org, repo, filepath, commit string) ([]byte, error) + GetRepo func(owner, name string) (FullRepo, error) + GetRepoLabels func(org, repo string) ([]Label, error) + GetRepos func(org string, isUser bool) ([]Repo, error) + IsCollaborator func(org, repo, user string) (bool, error) + ListCollaborators func(org, repo string) ([]User, error) + ListRepoTeams func(org, repo string) ([]Team, error) + RemoveBranchProtection func(org, repo, branch string) error + RemoveLabel func(org, repo string, number int, label string) error + UpdateBranchProtection func(org, repo, branch string, config BranchProtectionRequest) error + UpdateRepo func(owner, name string, repo RepoUpdateRequest) (*FullRepo, error) + UpdateRepoLabel func(org, repo, label, newName, description, color string) error + type RepositoryCommit struct + Author User + CommentsURL string + Commit GitCommit + Committer User + Files []CommitFile + HTMLURL string + NodeID string + Parents []GitCommit + SHA string + Stats *CommitStats + URL string + type RequiredPullRequestReviews struct + DismissStaleReviews bool + DismissalRestrictions *Restrictions + RequireCodeOwnerReviews bool + RequiredApprovingReviewCount int + type RequiredPullRequestReviewsRequest struct + DismissStaleReviews bool + DismissalRestrictions RestrictionsRequest + RequireCodeOwnerReviews bool + RequiredApprovingReviewCount int + type RequiredStatusChecks struct + Contexts []string + Strict bool + type RerunClient interface + GetIssueLabels func(org, repo string, number int) ([]Label, error) + GetTeamBySlug func(slug string, org string) (*Team, error) + IsCollaborator func(org, repo, user string) (bool, error) + IsMember func(org, user string) (bool, error) + TeamHasMember func(teamID int, memberLogin string) (bool, error) + type Restrictions struct + Teams []Team + Users []User + type RestrictionsRequest struct + Teams *[]string + Users *[]string + type Review struct + Body string + HTMLURL string + ID int + State ReviewState + SubmittedAt time.Time + User User + type ReviewAction string + type ReviewComment struct + Body string + CreatedAt time.Time + HTMLURL string + ID int + Path string + Position *int + ReviewID int + UpdatedAt time.Time + User User + type ReviewCommentEvent struct + Action ReviewCommentEventAction + Comment ReviewComment + GUID string + PullRequest PullRequest + Repo Repo + type ReviewCommentEventAction string + const ReviewCommentActionCreated + const ReviewCommentActionDeleted + const ReviewCommentActionEdited + type ReviewEvent struct + Action ReviewEventAction + GUID string + PullRequest PullRequest + Repo Repo + Review Review + type ReviewEventAction string + const ReviewActionDismissed + const ReviewActionEdited + const ReviewActionSubmitted + type ReviewState string + type SignatureVerification struct + Payload string + Reason string + Signature string + Verified bool + type SingleCommit struct + Commit struct{ ... } + type StateCannotBeChanged struct + Message string + func (s StateCannotBeChanged) Error() string + type Status struct + Context string + Description string + State string + TargetURL string + type StatusEvent struct + Context string + Description string + GUID string + ID int + Name string + Repo Repo + SHA string + Sender User + State string + TargetURL string + type Team struct + Description string + ID int + Name string + Parent *Team + ParentTeamID *int + Permission TeamPermission + Privacy string + Slug string + type TeamClient interface + CreateTeam func(org string, team Team) (*Team, error) + DeleteTeam func(id int) error + EditTeam func(t Team) (*Team, error) + GetTeamBySlug func(slug string, org string) (*Team, error) + ListTeamInvitations func(id int) ([]OrgInvitation, error) + ListTeamMembers func(id int, role string) ([]TeamMember, error) + ListTeamRepos func(id int) ([]Repo, error) + ListTeams func(org string) ([]Team, error) + RemoveTeamMembership func(id int, user string) error + RemoveTeamRepo func(id int, org, repo string) error + TeamHasMember func(teamID int, memberLogin string) (bool, error) + UpdateTeamMembership func(id int, user string, maintainer bool) (*TeamMembership, error) + UpdateTeamRepo func(id int, org, repo string, permission TeamPermission) error + type TeamMember struct + Login string + type TeamMembership struct + type TeamPermission string + const RepoAdmin + const RepoPull + const RepoPush + type Tree struct + SHA string + type UnauthorizedToPushError string + func (e UnauthorizedToPushError) Error() string + type UnmergablePRBaseChangedError string + func (e UnmergablePRBaseChangedError) Error() string + type UnmergablePRError string + func (e UnmergablePRError) Error() string + type User struct + Email string + HTMLURL string + ID int + Login string + Name string + Permissions RepoPermissions + Type string + type UserClient interface + BotName func() (string, error) + BotUser func() (*User, error) + Email func() (string, error)