Documentation ¶
Overview ¶
package gitee provides a client for using the GitHub API.
Usage:
import "github.com/weilaihui/go-gitee/gitee"
Construct a new GitHub client, then use the various services on the client to access different parts of the GitHub API. For example:
client := github.NewClient(nil) // list all organizations for user "willnorris" orgs, _, err := client.Organizations.List(ctx, "willnorris", nil)
Some API methods have optional parameters that can be passed. For example:
client := github.NewClient(nil) // list public repositories for org "github" opt := &github.RepositoryListByOrgOptions{Type: "public"} repos, _, err := client.Repositories.ListByOrg(ctx, "github", opt)
The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://developer.github.com/v3/.
Authentication ¶
The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for you. The easiest and recommended way to do this is using the golang.org/x/oauth2 library, but you can always use any other library that provides an http.Client. If you have an OAuth2 access token (for example, a personal API token), you can use it with the oauth2 library using:
import "golang.org/x/oauth2" func main() { ctx := context.Background() ts := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: "... your access token ..."}, ) tc := oauth2.NewClient(ctx, ts) client := github.NewClient(tc) // list all repositories for the authenticated user repos, _, err := client.Repositories.List(ctx, "", nil) }
Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users.
See the oauth2 docs for complete instructions on using that library.
For API methods that require HTTP Basic Authentication, use the BasicAuthTransport.
GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package.
import "github.com/bradleyfalzon/ghinstallation" func main() { // Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99. itr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, "2016-10-19.private-key.pem") if err != nil { // Handle error. } // Use installation transport with client client := github.NewClient(&http.Client{Transport: itr}) // Use client... }
Rate Limiting ¶
GitHub imposes a rate limit on all API clients. Unauthenticated clients are limited to 60 requests per hour, while authenticated clients can make up to 5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, use UnauthenticatedRateLimitedTransport.
The returned Response.Rate value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client.
To detect an API rate limit error, you can check if its type is *github.RateLimitError:
repos, _, err := client.Repositories.List(ctx, "", nil) if _, ok := err.(*github.RateLimitError); ok { log.Println("hit rate limit") }
Learn more about GitHub rate limiting at https://developer.github.com/v3/#rate-limiting.
Accepted Status ¶
Some endpoints may return a 202 Accepted status code, meaning that the information required is not yet ready and was scheduled to be gathered on the GitHub side. Methods known to behave like this are documented specifying this behavior.
To detect this condition of error, you can check if its type is *github.AcceptedError:
stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo) if _, ok := err.(*github.AcceptedError); ok { log.Println("scheduled on GitHub side") }
Conditional Requests ¶
The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that.
Learn more about GitHub conditional requests at https://developer.github.com/v3/#conditional-requests.
Creating and Updating Resources ¶
All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. Helper functions have been provided to easily create these pointers for string, bool, and int values. For example:
// create a new private repository named "foo" repo := &github.Repository{ Name: github.String("foo"), Private: github.Bool(true), } client.Repositories.Create(ctx, "", repo)
Users who have worked with protocol buffers should find this pattern familiar.
Pagination ¶
All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the github.ListOptions struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example github.PullRequestListOptions). Pages information is available via the github.Response struct.
client := github.NewClient(nil) opt := &github.RepositoryListByOrgOptions{ ListOptions: github.ListOptions{PerPage: 10}, } // get all pages of results var allRepos []*github.Repository for { repos, resp, err := client.Repositories.ListByOrg(ctx, "github", opt) if err != nil { return err } allRepos = append(allRepos, repos...) if resp.NextPage == 0 { break } opt.Page = resp.NextPage }
Google App Engine ¶
Go on App Engine Classic (which as of this writing uses Go 1.6) can not use the "context" import and still relies on "golang.org/x/net/context". As a result, if you wish to continue to use "go-github" on App Engine Classic, you will need to rewrite all the "context" imports using the following command:
gofmt -w -r '"context" -> "golang.org/x/net/context"' *.go
See "with_appengine.go" for more details.
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func DeliveryID(r *http.Request) string
- func Int(v int) *int
- func ParseWebHook(messageType string, payload []byte) (interface{}, error)
- func String(v string) *string
- func Stringify(message interface{}) string
- func ValidatePayload(r *http.Request, secretKey []byte) (payload []byte, err error)
- func WebHookType(r *http.Request) string
- type APIMeta
- type AbuseRateLimitError
- type AcceptedError
- type ActivityListStarredOptions
- type ActivityService
- func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error)
- func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error)
- func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (bool, *Response, error)
- func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error)
- func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error)
- func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error)
- func (s *ActivityService) ListEvents(ctx context.Context, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error)
- func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error)
- func (s *ActivityService) ListNotifications(ctx context.Context, opt *NotificationListOptions) ([]*Notification, *Response, error)
- func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opt *NotificationListOptions) ([]*Notification, *Response, error)
- func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Stargazer, *Response, error)
- func (s *ActivityService) ListStarred(ctx context.Context, user string, opt *ActivityListStarredOptions) ([]*StarredRepository, *Response, error)
- func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opt *ListOptions) ([]*Event, *Response, error)
- func (s *ActivityService) ListWatched(ctx context.Context, user string, opt *ListOptions) ([]*Repository, *Response, error)
- func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opt *ListOptions) ([]*User, *Response, error)
- func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error)
- func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error)
- func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error)
- func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string) (bool, *Response, error)
- func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error)
- func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error)
- func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error)
- type AdminEnforcement
- type AdminService
- type App
- type AppsService
- func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int) (*Repository, *Response, error)
- func (s *AppsService) CreateInstallationToken(ctx context.Context, id int) (*InstallationToken, *Response, error)
- func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error)
- func (s *AppsService) GetInstallation(ctx context.Context, id int) (*Installation, *Response, error)
- func (s *AppsService) ListInstallations(ctx context.Context, opt *ListOptions) ([]*Installation, *Response, error)
- func (s *AppsService) ListRepos(ctx context.Context, opt *ListOptions) ([]*Repository, *Response, error)
- func (s *AppsService) ListUserInstallations(ctx context.Context, opt *ListOptions) ([]*Installation, *Response, error)
- func (s *AppsService) ListUserRepos(ctx context.Context, id int, opt *ListOptions) ([]*Repository, *Response, error)
- func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int) (*Response, error)
- type Authorization
- func (a *Authorization) GetCreatedAt() Timestamp
- func (a *Authorization) GetFingerprint() string
- func (a *Authorization) GetHashedToken() string
- func (a *Authorization) GetID() int
- func (a *Authorization) GetNote() string
- func (a *Authorization) GetNoteURL() string
- func (a *Authorization) GetToken() string
- func (a *Authorization) GetTokenLastEight() string
- func (a *Authorization) GetURL() string
- func (a *Authorization) GetUpdatedAt() Timestamp
- func (a Authorization) String() string
- type AuthorizationApp
- type AuthorizationRequest
- func (a *AuthorizationRequest) GetClientID() string
- func (a *AuthorizationRequest) GetClientSecret() string
- func (a *AuthorizationRequest) GetFingerprint() string
- func (a *AuthorizationRequest) GetNote() string
- func (a *AuthorizationRequest) GetNoteURL() string
- func (a AuthorizationRequest) String() string
- type AuthorizationUpdateRequest
- type AuthorizationsService
- func (s *AuthorizationsService) Check(ctx context.Context, clientID string, token string) (*Authorization, *Response, error)
- func (s *AuthorizationsService) Create(ctx context.Context, auth *AuthorizationRequest) (*Authorization, *Response, error)
- func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error)
- func (s *AuthorizationsService) Delete(ctx context.Context, id int) (*Response, error)
- func (s *AuthorizationsService) DeleteGrant(ctx context.Context, id int) (*Response, error)
- func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error)
- func (s *AuthorizationsService) Edit(ctx context.Context, id int, auth *AuthorizationUpdateRequest) (*Authorization, *Response, error)
- func (s *AuthorizationsService) Get(ctx context.Context, id int) (*Authorization, *Response, error)
- func (s *AuthorizationsService) GetGrant(ctx context.Context, id int) (*Grant, *Response, error)
- func (s *AuthorizationsService) GetOrCreateForApp(ctx context.Context, clientID string, auth *AuthorizationRequest) (*Authorization, *Response, error)
- func (s *AuthorizationsService) List(ctx context.Context, opt *ListOptions) ([]*Authorization, *Response, error)
- func (s *AuthorizationsService) ListGrants(ctx context.Context, opt *ListOptions) ([]*Grant, *Response, error)
- func (s *AuthorizationsService) Reset(ctx context.Context, clientID string, token string) (*Authorization, *Response, error)
- func (s *AuthorizationsService) Revoke(ctx context.Context, clientID string, token string) (*Response, error)
- type BasicAuthTransport
- type Blob
- type Branch
- type BranchRestrictions
- type BranchRestrictionsRequest
- type Client
- func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error)
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)
- func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error)
- func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error)
- func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error)
- func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error)
- func (c *Client) Markdown(ctx context.Context, text string, opt *MarkdownOptions) (string, *Response, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error)
- func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error)
- func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error)
- func (c *Client) Zen(ctx context.Context) (string, *Response, error)
- type CodeOfConduct
- type CodeResult
- type CodeSearchResult
- type CombinedStatus
- func (c *CombinedStatus) GetCommitURL() string
- func (c *CombinedStatus) GetName() string
- func (c *CombinedStatus) GetRepositoryURL() string
- func (c *CombinedStatus) GetSHA() string
- func (c *CombinedStatus) GetState() string
- func (c *CombinedStatus) GetTotalCount() int
- func (s CombinedStatus) String() string
- type Commit
- type CommitAuthor
- type CommitCommentEvent
- type CommitFile
- func (c *CommitFile) GetAdditions() int
- func (c *CommitFile) GetBlobURL() string
- func (c *CommitFile) GetChanges() int
- func (c *CommitFile) GetContentsURL() string
- func (c *CommitFile) GetDeletions() int
- func (c *CommitFile) GetFilename() string
- func (c *CommitFile) GetPatch() string
- func (c *CommitFile) GetRawURL() string
- func (c *CommitFile) GetSHA() string
- func (c *CommitFile) GetStatus() string
- func (c CommitFile) String() string
- type CommitResult
- type CommitStats
- type CommitsComparison
- func (c *CommitsComparison) GetAheadBy() int
- func (c *CommitsComparison) GetBehindBy() int
- func (c *CommitsComparison) GetDiffURL() string
- func (c *CommitsComparison) GetHTMLURL() string
- func (c *CommitsComparison) GetPatchURL() string
- func (c *CommitsComparison) GetPermalinkURL() string
- func (c *CommitsComparison) GetStatus() string
- func (c *CommitsComparison) GetTotalCommits() int
- func (c *CommitsComparison) GetURL() string
- func (c CommitsComparison) String() string
- type CommitsListOptions
- type CommitsSearchResult
- type CommunityHealthFiles
- type CommunityHealthMetrics
- type Contributor
- func (c *Contributor) GetAvatarURL() string
- func (c *Contributor) GetContributions() int
- func (c *Contributor) GetEventsURL() string
- func (c *Contributor) GetFollowersURL() string
- func (c *Contributor) GetFollowingURL() string
- func (c *Contributor) GetGistsURL() string
- func (c *Contributor) GetGravatarID() string
- func (c *Contributor) GetHTMLURL() string
- func (c *Contributor) GetID() int
- func (c *Contributor) GetLogin() string
- func (c *Contributor) GetOrganizationsURL() string
- func (c *Contributor) GetReceivedEventsURL() string
- func (c *Contributor) GetReposURL() string
- func (c *Contributor) GetSiteAdmin() bool
- func (c *Contributor) GetStarredURL() string
- func (c *Contributor) GetSubscriptionsURL() string
- func (c *Contributor) GetType() string
- func (c *Contributor) GetURL() string
- type ContributorStats
- type CreateEvent
- type DeleteEvent
- type Deployment
- func (d *Deployment) GetCreatedAt() Timestamp
- func (d *Deployment) GetDescription() string
- func (d *Deployment) GetEnvironment() string
- func (d *Deployment) GetID() int
- func (d *Deployment) GetRef() string
- func (d *Deployment) GetRepositoryURL() string
- func (d *Deployment) GetSHA() string
- func (d *Deployment) GetStatusesURL() string
- func (d *Deployment) GetTask() string
- func (d *Deployment) GetURL() string
- func (d *Deployment) GetUpdatedAt() Timestamp
- type DeploymentEvent
- type DeploymentRequest
- func (d *DeploymentRequest) GetAutoMerge() bool
- func (d *DeploymentRequest) GetDescription() string
- func (d *DeploymentRequest) GetEnvironment() string
- func (d *DeploymentRequest) GetPayload() string
- func (d *DeploymentRequest) GetProductionEnvironment() bool
- func (d *DeploymentRequest) GetRef() string
- func (d *DeploymentRequest) GetRequiredContexts() []string
- func (d *DeploymentRequest) GetTask() string
- func (d *DeploymentRequest) GetTransientEnvironment() bool
- type DeploymentStatus
- func (d *DeploymentStatus) GetCreatedAt() Timestamp
- func (d *DeploymentStatus) GetDeploymentURL() string
- func (d *DeploymentStatus) GetDescription() string
- func (d *DeploymentStatus) GetID() int
- func (d *DeploymentStatus) GetRepositoryURL() string
- func (d *DeploymentStatus) GetState() string
- func (d *DeploymentStatus) GetTargetURL() string
- func (d *DeploymentStatus) GetUpdatedAt() Timestamp
- type DeploymentStatusEvent
- type DeploymentStatusRequest
- type DeploymentsListOptions
- type DismissalRestrictions
- type DismissalRestrictionsRequest
- type DraftReviewComment
- type EditChange
- type Error
- type ErrorResponse
- type Event
- func (e *Event) GetCreatedAt() time.Time
- func (e *Event) GetID() string
- func (e *Event) GetPublic() bool
- func (e *Event) GetRawPayload() json.RawMessage
- func (e *Event) GetType() string
- func (e *Event) ParsePayload() (payload interface{}, err error)
- func (e *Event) Payload() (payload interface{})deprecated
- func (e Event) String() string
- type FeedLink
- type Feeds
- type ForkEvent
- type GPGEmail
- type GPGKey
- func (g *GPGKey) GetCanCertify() bool
- func (g *GPGKey) GetCanEncryptComms() bool
- func (g *GPGKey) GetCanEncryptStorage() bool
- func (g *GPGKey) GetCanSign() bool
- func (g *GPGKey) GetCreatedAt() time.Time
- func (g *GPGKey) GetExpiresAt() time.Time
- func (g *GPGKey) GetID() int
- func (g *GPGKey) GetKeyID() string
- func (g *GPGKey) GetPrimaryKeyID() int
- func (g *GPGKey) GetPublicKey() string
- func (k GPGKey) String() string
- type Gist
- func (g *Gist) GetComments() int
- func (g *Gist) GetCreatedAt() time.Time
- func (g *Gist) GetDescription() string
- func (g *Gist) GetGitPullURL() string
- func (g *Gist) GetGitPushURL() string
- func (g *Gist) GetHTMLURL() string
- func (g *Gist) GetID() string
- func (g *Gist) GetPublic() bool
- func (g *Gist) GetUpdatedAt() time.Time
- func (g Gist) String() string
- type GistComment
- type GistCommit
- type GistFile
- type GistFilename
- type GistFork
- type GistListOptions
- type GistsService
- func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error)
- func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error)
- func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error)
- func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int) (*Response, error)
- func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error)
- func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int, comment *GistComment) (*GistComment, *Response, error)
- func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error)
- func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error)
- func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int) (*GistComment, *Response, error)
- func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error)
- func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error)
- func (s *GistsService) List(ctx context.Context, user string, opt *GistListOptions) ([]*Gist, *Response, error)
- func (s *GistsService) ListAll(ctx context.Context, opt *GistListOptions) ([]*Gist, *Response, error)
- func (s *GistsService) ListComments(ctx context.Context, gistID string, opt *ListOptions) ([]*GistComment, *Response, error)
- func (s *GistsService) ListCommits(ctx context.Context, id string, opt *ListOptions) ([]*GistCommit, *Response, error)
- func (s *GistsService) ListForks(ctx context.Context, id string) ([]*GistFork, *Response, error)
- func (s *GistsService) ListStarred(ctx context.Context, opt *GistListOptions) ([]*Gist, *Response, error)
- func (s *GistsService) Star(ctx context.Context, id string) (*Response, error)
- func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error)
- type GitObject
- type GitService
- func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error)
- func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error)
- func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error)
- func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error)
- func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, ...) (*Tree, *Response, error)
- func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error)
- func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error)
- func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error)
- func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error)
- func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref string) ([]*Reference, *Response, error)
- func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error)
- func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error)
- func (s *GitService) ListRefs(ctx context.Context, owner, repo string, opt *ReferenceListOptions) ([]*Reference, *Response, error)
- func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error)
- type Gitignore
- type GitignoresService
- type GollumEvent
- type Grant
- type Hook
- type Import
- func (i *Import) GetAuthorsCount() int
- func (i *Import) GetAuthorsURL() string
- func (i *Import) GetCommitCount() int
- func (i *Import) GetFailedStep() string
- func (i *Import) GetHTMLURL() string
- func (i *Import) GetHasLargeFiles() bool
- func (i *Import) GetHumanName() string
- func (i *Import) GetLargeFilesCount() int
- func (i *Import) GetLargeFilesSize() int
- func (i *Import) GetMessage() string
- func (i *Import) GetPercent() int
- func (i *Import) GetPushPercent() int
- func (i *Import) GetRepositoryURL() string
- func (i *Import) GetStatus() string
- func (i *Import) GetStatusText() string
- func (i *Import) GetTFVCProject() string
- func (i *Import) GetURL() string
- func (i *Import) GetUseLFS() string
- func (i *Import) GetVCS() string
- func (i *Import) GetVCSPassword() string
- func (i *Import) GetVCSURL() string
- func (i *Import) GetVCSUsername() string
- func (i Import) String() string
- type Installation
- type InstallationEvent
- type InstallationRepositoriesEvent
- type InstallationToken
- type Invitation
- type Issue
- func (i *Issue) GetBody() string
- func (i *Issue) GetClosedAt() time.Time
- func (i *Issue) GetComments() int
- func (i *Issue) GetCommentsURL() string
- func (i *Issue) GetCreatedAt() time.Time
- func (i *Issue) GetEventsURL() string
- func (i *Issue) GetHTMLURL() string
- func (i *Issue) GetID() int
- func (i *Issue) GetLabelsURL() string
- func (i *Issue) GetLocked() bool
- func (i *Issue) GetNumber() int
- func (i *Issue) GetRepositoryURL() string
- func (i *Issue) GetState() string
- func (i *Issue) GetTitle() string
- func (i *Issue) GetURL() string
- func (i *Issue) GetUpdatedAt() time.Time
- func (i Issue) IsPullRequest() bool
- func (i Issue) String() string
- type IssueComment
- func (i *IssueComment) GetBody() string
- func (i *IssueComment) GetCreatedAt() time.Time
- func (i *IssueComment) GetHTMLURL() string
- func (i *IssueComment) GetID() int
- func (i *IssueComment) GetIssueURL() string
- func (i *IssueComment) GetURL() string
- func (i *IssueComment) GetUpdatedAt() time.Time
- func (i IssueComment) String() string
- type IssueCommentEvent
- type IssueEvent
- type IssueListByRepoOptions
- type IssueListCommentsOptions
- type IssueListOptions
- type IssueRequest
- type IssuesEvent
- type IssuesSearchResult
- type IssuesService
- func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error)
- func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error)
- func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error)
- func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, ...) (*IssueComment, *Response, error)
- func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error)
- func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error)
- func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, id int) (*Response, error)
- func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error)
- func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error)
- func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, ...) (*Issue, *Response, error)
- func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, id int, comment *IssueComment) (*IssueComment, *Response, error)
- func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error)
- func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, ...) (*Milestone, *Response, error)
- func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error)
- func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, id int) (*IssueComment, *Response, error)
- func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int) (*IssueEvent, *Response, error)
- func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error)
- func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error)
- func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error)
- func (s *IssuesService) List(ctx context.Context, all bool, opt *IssueListOptions) ([]*Issue, *Response, error)
- func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opt *ListOptions) ([]*User, *Response, error)
- func (s *IssuesService) ListByOrg(ctx context.Context, org string, opt *IssueListOptions) ([]*Issue, *Response, error)
- func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opt *IssueListByRepoOptions) ([]*Issue, *Response, error)
- func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, ...) ([]*IssueComment, *Response, error)
- func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*IssueEvent, *Response, error)
- func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*Timeline, *Response, error)
- func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Label, *Response, error)
- func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error)
- func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error)
- func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opt *MilestoneListOptions) ([]*Milestone, *Response, error)
- func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error)
- func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int) (*Response, error)
- func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error)
- func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error)
- func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error)
- func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error)
- func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error)
- type Key
- type Label
- type LabelEvent
- type LargeFile
- type License
- func (l *License) GetBody() string
- func (l *License) GetConditions() []string
- func (l *License) GetDescription() string
- func (l *License) GetFeatured() bool
- func (l *License) GetHTMLURL() string
- func (l *License) GetImplementation() string
- func (l *License) GetKey() string
- func (l *License) GetLimitations() []string
- func (l *License) GetName() string
- func (l *License) GetPermissions() []string
- func (l *License) GetSPDXID() string
- func (l *License) GetURL() string
- func (l License) String() string
- type LicensesService
- type ListCollaboratorsOptions
- type ListContributorsOptions
- type ListMembersOptions
- type ListOptions
- type ListOrgMembershipsOptions
- type ListOutsideCollaboratorsOptions
- type MarkdownOptions
- type Match
- type MemberEvent
- type Membership
- type MembershipEvent
- type Metric
- type Migration
- func (m *Migration) GetCreatedAt() string
- func (m *Migration) GetExcludeAttachments() bool
- func (m *Migration) GetGUID() string
- func (m *Migration) GetID() int
- func (m *Migration) GetLockRepositories() bool
- func (m *Migration) GetState() string
- func (m *Migration) GetURL() string
- func (m *Migration) GetUpdatedAt() string
- func (m Migration) String() string
- type MigrationOptions
- type MigrationService
- func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error)
- func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error)
- func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int) (*Response, error)
- func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error)
- func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error)
- func (s *MigrationService) ListMigrations(ctx context.Context, org string) ([]*Migration, *Response, error)
- func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error)
- func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int) (url string, err error)
- func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int) (*Migration, *Response, error)
- func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)
- func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)
- func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opt *MigrationOptions) (*Migration, *Response, error)
- func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int, repo string) (*Response, error)
- func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)
- type Milestone
- func (m *Milestone) GetClosedAt() time.Time
- func (m *Milestone) GetClosedIssues() int
- func (m *Milestone) GetCreatedAt() time.Time
- func (m *Milestone) GetDescription() string
- func (m *Milestone) GetDueOn() time.Time
- func (m *Milestone) GetHTMLURL() string
- func (m *Milestone) GetID() int
- func (m *Milestone) GetLabelsURL() string
- func (m *Milestone) GetNumber() int
- func (m *Milestone) GetOpenIssues() int
- func (m *Milestone) GetState() string
- func (m *Milestone) GetTitle() string
- func (m *Milestone) GetURL() string
- func (m *Milestone) GetUpdatedAt() time.Time
- func (m Milestone) String() string
- type MilestoneEvent
- type MilestoneListOptions
- type NewPullRequest
- type NewTeam
- type Notification
- type NotificationListOptions
- type NotificationSubject
- type OAuthTransport
- type OrgBlockEvent
- type Organization
- func (o *Organization) GetAvatarURL() string
- func (o *Organization) GetBillingEmail() string
- func (o *Organization) GetBlog() string
- func (o *Organization) GetCollaborators() int
- func (o *Organization) GetCompany() string
- func (o *Organization) GetCreatedAt() time.Time
- func (o *Organization) GetDescription() string
- func (o *Organization) GetDiskUsage() int
- func (o *Organization) GetEmail() string
- func (o *Organization) GetEventsURL() string
- func (o *Organization) GetFollowers() int
- func (o *Organization) GetFollowing() int
- func (o *Organization) GetHTMLURL() string
- func (o *Organization) GetHooksURL() string
- func (o *Organization) GetID() int
- func (o *Organization) GetIssuesURL() string
- func (o *Organization) GetLocation() string
- func (o *Organization) GetLogin() string
- func (o *Organization) GetMembersURL() string
- func (o *Organization) GetName() string
- func (o *Organization) GetOwnedPrivateRepos() int
- func (o *Organization) GetPrivateGists() int
- func (o *Organization) GetPublicGists() int
- func (o *Organization) GetPublicMembersURL() string
- func (o *Organization) GetPublicRepos() int
- func (o *Organization) GetReposURL() string
- func (o *Organization) GetTotalPrivateRepos() int
- func (o *Organization) GetType() string
- func (o *Organization) GetURL() string
- func (o *Organization) GetUpdatedAt() time.Time
- func (o Organization) String() string
- type OrganizationAddTeamMembershipOptions
- type OrganizationAddTeamRepoOptions
- type OrganizationEvent
- type OrganizationListTeamMembersOptions
- type OrganizationsListOptions
- type OrganizationsService
- func (s *OrganizationsService) AddTeamMembership(ctx context.Context, team int, user string, ...) (*Membership, *Response, error)
- func (s *OrganizationsService) AddTeamRepo(ctx context.Context, team int, owner string, repo string, ...) (*Response, error)
- func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error)
- func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error)
- func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error)
- func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opt *ProjectOptions) (*Project, *Response, error)
- func (s *OrganizationsService) CreateTeam(ctx context.Context, org string, team *NewTeam) (*Team, *Response, error)
- func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int) (*Response, error)
- func (s *OrganizationsService) DeleteTeam(ctx context.Context, team int) (*Response, error)
- func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error)
- func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int, hook *Hook) (*Hook, *Response, error)
- func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error)
- func (s *OrganizationsService) EditTeam(ctx context.Context, id int, team *NewTeam) (*Team, *Response, error)
- func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error)
- func (s *OrganizationsService) GetByID(ctx context.Context, id int) (*Organization, *Response, error)
- func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int) (*Hook, *Response, error)
- func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error)
- func (s *OrganizationsService) GetTeam(ctx context.Context, team int) (*Team, *Response, error)
- func (s *OrganizationsService) GetTeamMembership(ctx context.Context, team int, user string) (*Membership, *Response, error)
- func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error)
- func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error)
- func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error)
- func (s *OrganizationsService) IsTeamMember(ctx context.Context, team int, user string) (bool, *Response, error)deprecated
- func (s *OrganizationsService) IsTeamRepo(ctx context.Context, team int, owner string, repo string) (*Repository, *Response, error)
- func (s *OrganizationsService) List(ctx context.Context, user string, opt *ListOptions) ([]*Organization, *Response, error)
- func (s *OrganizationsService) ListAll(ctx context.Context, opt *OrganizationsListOptions) ([]*Organization, *Response, error)
- func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opt *ListOptions) ([]*User, *Response, error)
- func (s *OrganizationsService) ListChildTeams(ctx context.Context, teamID int, opt *ListOptions) ([]*Team, *Response, error)
- func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opt *ListOptions) ([]*Hook, *Response, error)
- func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opt *ListMembersOptions) ([]*User, *Response, error)
- func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opt *ListOrgMembershipsOptions) ([]*Membership, *Response, error)
- func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opt *ListOutsideCollaboratorsOptions) ([]*User, *Response, error)
- func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opt *ListOptions) ([]*Invitation, *Response, error)
- func (s *OrganizationsService) ListPendingTeamInvitations(ctx context.Context, team int, opt *ListOptions) ([]*Invitation, *Response, error)
- func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt *ProjectListOptions) ([]*Project, *Response, error)
- func (s *OrganizationsService) ListTeamMembers(ctx context.Context, team int, opt *OrganizationListTeamMembersOptions) ([]*User, *Response, error)
- func (s *OrganizationsService) ListTeamRepos(ctx context.Context, team int, opt *ListOptions) ([]*Repository, *Response, error)
- func (s *OrganizationsService) ListTeams(ctx context.Context, org string, opt *ListOptions) ([]*Team, *Response, error)
- func (s *OrganizationsService) ListUserTeams(ctx context.Context, opt *ListOptions) ([]*Team, *Response, error)
- func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int) (*Response, error)
- func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error)
- func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error)
- func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error)
- func (s *OrganizationsService) RemoveTeamMembership(ctx context.Context, team int, user string) (*Response, error)
- func (s *OrganizationsService) RemoveTeamRepo(ctx context.Context, team int, owner string, repo string) (*Response, error)
- func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error)
- type Page
- type PageBuildEvent
- type Pages
- type PagesBuild
- type PagesError
- type PingEvent
- type Plan
- type Project
- func (p *Project) GetBody() string
- func (p *Project) GetCreatedAt() Timestamp
- func (p *Project) GetID() int
- func (p *Project) GetName() string
- func (p *Project) GetNumber() int
- func (p *Project) GetOwnerURL() string
- func (p *Project) GetURL() string
- func (p *Project) GetUpdatedAt() Timestamp
- func (p Project) String() string
- type ProjectCard
- func (p *ProjectCard) GetColumnID() int
- func (p *ProjectCard) GetColumnURL() string
- func (p *ProjectCard) GetContentURL() string
- func (p *ProjectCard) GetCreatedAt() Timestamp
- func (p *ProjectCard) GetID() int
- func (p *ProjectCard) GetNote() string
- func (p *ProjectCard) GetURL() string
- func (p *ProjectCard) GetUpdatedAt() Timestamp
- type ProjectCardChange
- type ProjectCardEvent
- type ProjectCardMoveOptions
- type ProjectCardOptions
- type ProjectChange
- type ProjectColumn
- type ProjectColumnChange
- type ProjectColumnEvent
- type ProjectColumnMoveOptions
- type ProjectColumnOptions
- type ProjectEvent
- type ProjectListOptions
- type ProjectOptions
- type ProjectsService
- func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int, opt *ProjectCardOptions) (*ProjectCard, *Response, error)
- func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int, opt *ProjectColumnOptions) (*ProjectColumn, *Response, error)
- func (s *ProjectsService) DeleteProject(ctx context.Context, id int) (*Response, error)
- func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int) (*Response, error)
- func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int) (*Response, error)
- func (s *ProjectsService) GetProject(ctx context.Context, id int) (*Project, *Response, error)
- func (s *ProjectsService) GetProjectCard(ctx context.Context, columnID int) (*ProjectCard, *Response, error)
- func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int) (*ProjectColumn, *Response, error)
- func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int, opt *ListOptions) ([]*ProjectCard, *Response, error)
- func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int, opt *ListOptions) ([]*ProjectColumn, *Response, error)
- func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int, opt *ProjectCardMoveOptions) (*Response, error)
- func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int, opt *ProjectColumnMoveOptions) (*Response, error)
- func (s *ProjectsService) UpdateProject(ctx context.Context, id int, opt *ProjectOptions) (*Project, *Response, error)
- func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int, opt *ProjectCardOptions) (*ProjectCard, *Response, error)
- func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int, opt *ProjectColumnOptions) (*ProjectColumn, *Response, error)
- type Protection
- type ProtectionRequest
- type PublicEvent
- type PullRequest
- func (p *PullRequest) GetAdditions() int
- func (p *PullRequest) GetBody() string
- func (p *PullRequest) GetChangedFiles() int
- func (p *PullRequest) GetClosedAt() time.Time
- func (p *PullRequest) GetComments() int
- func (p *PullRequest) GetCommits() int
- func (p *PullRequest) GetCreatedAt() time.Time
- func (p *PullRequest) GetDeletions() int
- func (p *PullRequest) GetDiffURL() string
- func (p *PullRequest) GetHTMLURL() string
- func (p *PullRequest) GetID() int
- func (p *PullRequest) GetIssueURL() string
- func (p *PullRequest) GetMaintainerCanModify() bool
- func (p *PullRequest) GetMergeCommitSHA() string
- func (p *PullRequest) GetMergeable() bool
- func (p *PullRequest) GetMerged() bool
- func (p *PullRequest) GetMergedAt() time.Time
- func (p *PullRequest) GetNumber() int
- func (p *PullRequest) GetPatchURL() string
- func (p *PullRequest) GetReviewCommentURL() string
- func (p *PullRequest) GetReviewCommentsURL() string
- func (p *PullRequest) GetState() string
- func (p *PullRequest) GetStatusesURL() string
- func (p *PullRequest) GetTitle() string
- func (p *PullRequest) GetURL() string
- func (p *PullRequest) GetUpdatedAt() time.Time
- func (p PullRequest) String() string
- type PullRequestBranch
- type PullRequestComment
- func (p *PullRequestComment) GetBody() string
- func (p *PullRequestComment) GetCommitID() string
- func (p *PullRequestComment) GetCreatedAt() time.Time
- func (p *PullRequestComment) GetDiffHunk() string
- func (p *PullRequestComment) GetHTMLURL() string
- func (p *PullRequestComment) GetID() int
- func (p *PullRequestComment) GetInReplyTo() int
- func (p *PullRequestComment) GetOriginalCommitID() string
- func (p *PullRequestComment) GetOriginalPosition() int
- func (p *PullRequestComment) GetPath() string
- func (p *PullRequestComment) GetPosition() int
- func (p *PullRequestComment) GetPullRequestURL() string
- func (p *PullRequestComment) GetURL() string
- func (p *PullRequestComment) GetUpdatedAt() time.Time
- func (p PullRequestComment) String() string
- type PullRequestEvent
- type PullRequestLinks
- type PullRequestListCommentsOptions
- type PullRequestListOptions
- type PullRequestMergeResult
- type PullRequestOptions
- type PullRequestReview
- func (p *PullRequestReview) GetBody() string
- func (p *PullRequestReview) GetCommitID() string
- func (p *PullRequestReview) GetHTMLURL() string
- func (p *PullRequestReview) GetID() int
- func (p *PullRequestReview) GetPullRequestURL() string
- func (p *PullRequestReview) GetState() string
- func (p *PullRequestReview) GetSubmittedAt() time.Time
- func (p PullRequestReview) String() string
- type PullRequestReviewCommentEvent
- type PullRequestReviewDismissalRequest
- type PullRequestReviewEvent
- type PullRequestReviewRequest
- type PullRequestReviewsEnforcement
- type PullRequestReviewsEnforcementRequest
- type PullRequestReviewsEnforcementUpdate
- type PullRequestsService
- func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error)
- func (s *PullRequestsService) CreateComment(ctx context.Context, owner string, repo string, number int, ...) (*PullRequestComment, *Response, error)
- func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, ...) (*PullRequestReview, *Response, error)
- func (s *PullRequestsService) DeleteComment(ctx context.Context, owner string, repo string, number int) (*Response, error)
- func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error)
- func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number, reviewID int, ...) (*PullRequestReview, *Response, error)
- func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error)
- func (s *PullRequestsService) EditComment(ctx context.Context, owner string, repo string, number int, ...) (*PullRequestComment, *Response, error)
- func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error)
- func (s *PullRequestsService) GetComment(ctx context.Context, owner string, repo string, number int) (*PullRequestComment, *Response, error)
- func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opt RawOptions) (string, *Response, error)
- func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error)
- func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error)
- func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opt *PullRequestListOptions) ([]*PullRequest, *Response, error)
- func (s *PullRequestsService) ListComments(ctx context.Context, owner string, repo string, number int, ...) ([]*PullRequestComment, *Response, error)
- func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*RepositoryCommit, *Response, error)
- func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*CommitFile, *Response, error)
- func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number, reviewID int, ...) ([]*PullRequestComment, *Response, error)
- func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int, opt *ListOptions) (*Reviewers, *Response, error)
- func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*PullRequestReview, *Response, error)
- func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, ...) (*PullRequestMergeResult, *Response, error)
- func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, ...) (*Response, error)
- func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, ...) (*PullRequest, *Response, error)
- func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number, reviewID int, ...) (*PullRequestReview, *Response, error)
- type PunchCard
- type PushEvent
- func (p *PushEvent) GetAfter() string
- func (p *PushEvent) GetBaseRef() string
- func (p *PushEvent) GetBefore() string
- func (p *PushEvent) GetCompare() string
- func (p *PushEvent) GetCreated() bool
- func (p *PushEvent) GetDeleted() bool
- func (p *PushEvent) GetDistinctSize() int
- func (p *PushEvent) GetForced() bool
- func (p *PushEvent) GetHead() string
- func (p *PushEvent) GetPushID() int
- func (p *PushEvent) GetRef() string
- func (p *PushEvent) GetSize() int
- func (p PushEvent) String() string
- type PushEventCommit
- func (p *PushEventCommit) GetDistinct() bool
- func (p *PushEventCommit) GetID() string
- func (p *PushEventCommit) GetMessage() string
- func (p *PushEventCommit) GetSHA() string
- func (p *PushEventCommit) GetTimestamp() Timestamp
- func (p *PushEventCommit) GetTreeID() string
- func (p *PushEventCommit) GetURL() string
- func (p PushEventCommit) String() string
- type PushEventRepoOwner
- type PushEventRepository
- func (p *PushEventRepository) GetArchiveURL() string
- func (p *PushEventRepository) GetCloneURL() string
- func (p *PushEventRepository) GetCreatedAt() Timestamp
- func (p *PushEventRepository) GetDefaultBranch() string
- func (p *PushEventRepository) GetDescription() string
- func (p *PushEventRepository) GetFork() bool
- func (p *PushEventRepository) GetForksCount() int
- func (p *PushEventRepository) GetFullName() string
- func (p *PushEventRepository) GetGitURL() string
- func (p *PushEventRepository) GetHTMLURL() string
- func (p *PushEventRepository) GetHasDownloads() bool
- func (p *PushEventRepository) GetHasIssues() bool
- func (p *PushEventRepository) GetHasPages() bool
- func (p *PushEventRepository) GetHasWiki() bool
- func (p *PushEventRepository) GetHomepage() string
- func (p *PushEventRepository) GetID() int
- func (p *PushEventRepository) GetLanguage() string
- func (p *PushEventRepository) GetMasterBranch() string
- func (p *PushEventRepository) GetName() string
- func (p *PushEventRepository) GetOpenIssuesCount() int
- func (p *PushEventRepository) GetOrganization() string
- func (p *PushEventRepository) GetPrivate() bool
- func (p *PushEventRepository) GetPushedAt() Timestamp
- func (p *PushEventRepository) GetSSHURL() string
- func (p *PushEventRepository) GetSVNURL() string
- func (p *PushEventRepository) GetSize() int
- func (p *PushEventRepository) GetStargazersCount() int
- func (p *PushEventRepository) GetStatusesURL() string
- func (p *PushEventRepository) GetURL() string
- func (p *PushEventRepository) GetUpdatedAt() Timestamp
- func (p *PushEventRepository) GetWatchersCount() int
- type Rate
- type RateLimitError
- type RateLimits
- type RawOptions
- type RawType
- type Reaction
- type Reactions
- type ReactionsService
- func (s ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int, content string) (*Reaction, *Response, error)
- func (s ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int, content string) (*Reaction, *Response, error)
- func (s ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error)
- func (s ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int, content string) (*Reaction, *Response, error)
- func (s *ReactionsService) DeleteReaction(ctx context.Context, id int) (*Response, error)
- func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int, opt *ListOptions) ([]*Reaction, *Response, error)
- func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int, opt *ListOptions) ([]*Reaction, *Response, error)
- func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*Reaction, *Response, error)
- func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int, opt *ListOptions) ([]*Reaction, *Response, error)
- type Reference
- type ReferenceListOptions
- type ReleaseAsset
- func (r *ReleaseAsset) GetBrowserDownloadURL() string
- func (r *ReleaseAsset) GetContentType() string
- func (r *ReleaseAsset) GetCreatedAt() Timestamp
- func (r *ReleaseAsset) GetDownloadCount() int
- func (r *ReleaseAsset) GetID() int
- func (r *ReleaseAsset) GetLabel() string
- func (r *ReleaseAsset) GetName() string
- func (r *ReleaseAsset) GetSize() int
- func (r *ReleaseAsset) GetState() string
- func (r *ReleaseAsset) GetURL() string
- func (r *ReleaseAsset) GetUpdatedAt() Timestamp
- func (r ReleaseAsset) String() string
- type ReleaseEvent
- type Rename
- type RepoStatus
- func (r *RepoStatus) GetContext() string
- func (r *RepoStatus) GetCreatedAt() time.Time
- func (r *RepoStatus) GetDescription() string
- func (r *RepoStatus) GetID() int
- func (r *RepoStatus) GetState() string
- func (r *RepoStatus) GetTargetURL() string
- func (r *RepoStatus) GetURL() string
- func (r *RepoStatus) GetUpdatedAt() time.Time
- func (r RepoStatus) String() string
- type RepositoriesSearchResult
- type RepositoriesService
- func (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error)
- func (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, ...) (*Response, error)
- func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string) (*CommitsComparison, *Response, error)
- func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error)
- func (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error)
- func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error)
- func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int, ...) (*DeploymentStatus, *Response, error)
- func (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, ...) (*RepositoryContentResponse, *Response, error)
- func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opt *RepositoryCreateForkOptions) (*Repository, *Response, error)
- func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error)
- func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error)
- func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opt *ProjectOptions) (*Project, *Response, error)
- func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error)
- func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error)
- func (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, ...) (*RepositoryContentResponse, *Response, error)
- func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int) (*Response, error)
- func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int) (*Response, error)
- func (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error)
- func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, ...) (io.ReadCloser, error)
- func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int) (rc io.ReadCloser, redirectURL string, err error)
- func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error)
- func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int, hook *Hook) (*Hook, *Response, error)
- func (s *RepositoriesService) EditKey(ctx context.Context, owner string, repo string, id int, key *Key) (*Key, *Response, error)
- func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int, release *RepositoryRelease) (*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int, release *ReleaseAsset) (*ReleaseAsset, *Response, error)
- func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error)
- func (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error)
- func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat archiveFormat, ...) (*url.URL, *Response, error)
- func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string) (*Branch, *Response, error)
- func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error)
- func (s *RepositoriesService) GetByID(ctx context.Context, id int) (*Repository, *Response, error)
- func (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error)
- func (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error)
- func (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int) (*RepositoryComment, *Response, error)
- func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string) (*RepositoryCommit, *Response, error)
- func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opt RawOptions) (string, *Response, error)
- func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error)
- func (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error)
- func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, ...) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, ...)
- func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int) (*Deployment, *Response, error)
- func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int) (*DeploymentStatus, *Response, error)
- func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int) (*Hook, *Response, error)
- func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int) (*Key, *Response, error)
- func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error)
- func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int) (*PagesBuild, *Response, error)
- func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error)
- func (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error)
- func (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error)
- func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opt *RepositoryContentGetOptions) (*RepositoryContent, *Response, error)
- func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int) (*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int) (*ReleaseAsset, *Response, error)
- func (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error)
- func (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error)
- func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error)
- func (s *RepositoriesService) List(ctx context.Context, user string, opt *RepositoryListOptions) ([]*Repository, *Response, error)
- func (s *RepositoriesService) ListAll(ctx context.Context, opt *RepositoryListAllOptions) ([]*Repository, *Response, error)
- func (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string) (*Topics, *Response, error)
- func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Branch, *Response, error)
- func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opt *RepositoryListByOrgOptions) ([]*Repository, *Response, error)
- func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error)
- func (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opt *ListCollaboratorsOptions) ([]*User, *Response, error)
- func (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opt *ListOptions) ([]*RepositoryComment, *Response, error)
- func (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error)
- func (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opt *ListOptions) ([]*RepositoryComment, *Response, error)
- func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opt *CommitsListOptions) ([]*RepositoryCommit, *Response, error)
- func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, ...) ([]*Contributor, *Response, error)
- func (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error)
- func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int, opt *ListOptions) ([]*DeploymentStatus, *Response, error)
- func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opt *DeploymentsListOptions) ([]*Deployment, *Response, error)
- func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opt *RepositoryListForksOptions) ([]*Repository, *Response, error)
- func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Hook, *Response, error)
- func (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opt *ListOptions) ([]*RepositoryInvitation, *Response, error)
- func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Key, *Response, error)
- func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error)
- func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opt *ListOptions) ([]*PagesBuild, *Response, error)
- func (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error)
- func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opt *ProjectListOptions) ([]*Project, *Response, error)
- func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error)
- func (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int, opt *ListOptions) ([]*ReleaseAsset, *Response, error)
- func (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opt *ListOptions) ([]*RepositoryRelease, *Response, error)
- func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error)
- func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error)
- func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*RepositoryTag, *Response, error)
- func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Team, *Response, error)
- func (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opt *TrafficBreakdownOptions) (*TrafficClones, *Response, error)
- func (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error)
- func (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error)
- func (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opt *TrafficBreakdownOptions) (*TrafficViews, *Response, error)
- func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error)
- func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error)
- func (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error)
- func (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error)
- func (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error)
- func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics *Topics) (*Topics, *Response, error)
- func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error)
- func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int) (*Response, error)
- func (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (bool, *Response, error)
- func (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int, comment *RepositoryComment) (*RepositoryComment, *Response, error)
- func (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, ...) (*RepositoryContentResponse, *Response, error)
- func (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int, permissions string) (*RepositoryInvitation, *Response, error)
- func (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, ...) (*PullRequestReviewsEnforcement, *Response, error)
- func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int, opt *UploadOptions, ...) (*ReleaseAsset, *Response, error)
- type Repository
- func (r *Repository) GetAllowMergeCommit() bool
- func (r *Repository) GetAllowRebaseMerge() bool
- func (r *Repository) GetAllowSquashMerge() bool
- func (r *Repository) GetArchiveURL() string
- func (r *Repository) GetAssigneesURL() string
- func (r *Repository) GetAutoInit() bool
- func (r *Repository) GetBlobsURL() string
- func (r *Repository) GetBranchesURL() string
- func (r *Repository) GetCloneURL() string
- func (r *Repository) GetCollaboratorsURL() string
- func (r *Repository) GetCommentsURL() string
- func (r *Repository) GetCommitsURL() string
- func (r *Repository) GetCompareURL() string
- func (r *Repository) GetContentsURL() string
- func (r *Repository) GetContributorsURL() string
- func (r *Repository) GetCreatedAt() Timestamp
- func (r *Repository) GetDefaultBranch() string
- func (r *Repository) GetDeploymentsURL() string
- func (r *Repository) GetDescription() string
- func (r *Repository) GetDownloadsURL() string
- func (r *Repository) GetEventsURL() string
- func (r *Repository) GetFork() bool
- func (r *Repository) GetForksCount() int
- func (r *Repository) GetForksURL() string
- func (r *Repository) GetFullName() string
- func (r *Repository) GetGitCommitsURL() string
- func (r *Repository) GetGitRefsURL() string
- func (r *Repository) GetGitTagsURL() string
- func (r *Repository) GetGitURL() string
- func (r *Repository) GetGitignoreTemplate() string
- func (r *Repository) GetHTMLURL() string
- func (r *Repository) GetHasDownloads() bool
- func (r *Repository) GetHasIssues() bool
- func (r *Repository) GetHasPages() bool
- func (r *Repository) GetHasWiki() bool
- func (r *Repository) GetHomepage() string
- func (r *Repository) GetHooksURL() string
- func (r *Repository) GetID() int
- func (r *Repository) GetIssueCommentURL() string
- func (r *Repository) GetIssueEventsURL() string
- func (r *Repository) GetIssuesURL() string
- func (r *Repository) GetKeysURL() string
- func (r *Repository) GetLabelsURL() string
- func (r *Repository) GetLanguage() string
- func (r *Repository) GetLanguagesURL() string
- func (r *Repository) GetLicenseTemplate() string
- func (r *Repository) GetMasterBranch() string
- func (r *Repository) GetMergesURL() string
- func (r *Repository) GetMilestonesURL() string
- func (r *Repository) GetMirrorURL() string
- func (r *Repository) GetName() string
- func (r *Repository) GetNetworkCount() int
- func (r *Repository) GetNotificationsURL() string
- func (r *Repository) GetOpenIssuesCount() int
- func (r *Repository) GetPermissions() map[string]bool
- func (r *Repository) GetPrivate() bool
- func (r *Repository) GetPullsURL() string
- func (r *Repository) GetPushedAt() Timestamp
- func (r *Repository) GetReleasesURL() string
- func (r *Repository) GetSSHURL() string
- func (r *Repository) GetSVNURL() string
- func (r *Repository) GetSize() int
- func (r *Repository) GetStargazersCount() int
- func (r *Repository) GetStargazersURL() string
- func (r *Repository) GetStatusesURL() string
- func (r *Repository) GetSubscribersCount() int
- func (r *Repository) GetSubscribersURL() string
- func (r *Repository) GetSubscriptionURL() string
- func (r *Repository) GetTagsURL() string
- func (r *Repository) GetTeamID() int
- func (r *Repository) GetTeamsURL() string
- func (r *Repository) GetTreesURL() string
- func (r *Repository) GetURL() string
- func (r *Repository) GetUpdatedAt() Timestamp
- func (r *Repository) GetWatchersCount() int
- func (r Repository) String() string
- type RepositoryAddCollaboratorOptions
- type RepositoryComment
- func (r *RepositoryComment) GetBody() string
- func (r *RepositoryComment) GetCommitID() string
- func (r *RepositoryComment) GetCreatedAt() time.Time
- func (r *RepositoryComment) GetHTMLURL() string
- func (r *RepositoryComment) GetID() int
- func (r *RepositoryComment) GetPath() string
- func (r *RepositoryComment) GetPosition() int
- func (r *RepositoryComment) GetURL() string
- func (r *RepositoryComment) GetUpdatedAt() time.Time
- func (r RepositoryComment) String() string
- type RepositoryCommit
- type RepositoryCommitParent
- type RepositoryContent
- func (r *RepositoryContent) GetContent() (string, error)
- func (r *RepositoryContent) GetDownloadURL() string
- func (r *RepositoryContent) GetEncoding() string
- func (r *RepositoryContent) GetGitURL() string
- func (r *RepositoryContent) GetHTMLURL() string
- func (r *RepositoryContent) GetName() string
- func (r *RepositoryContent) GetPath() string
- func (r *RepositoryContent) GetSHA() string
- func (r *RepositoryContent) GetSize() int
- func (r *RepositoryContent) GetType() string
- func (r *RepositoryContent) GetURL() string
- func (r RepositoryContent) String() string
- type RepositoryContentFileOptions
- type RepositoryContentGetOptions
- type RepositoryContentResponse
- type RepositoryCreateForkOptions
- type RepositoryEvent
- type RepositoryInvitation
- type RepositoryLicense
- func (r *RepositoryLicense) GetContent() string
- func (r *RepositoryLicense) GetDownloadURL() string
- func (r *RepositoryLicense) GetEncoding() string
- func (r *RepositoryLicense) GetGitURL() string
- func (r *RepositoryLicense) GetHTMLURL() string
- func (r *RepositoryLicense) GetName() string
- func (r *RepositoryLicense) GetPath() string
- func (r *RepositoryLicense) GetSHA() string
- func (r *RepositoryLicense) GetSize() int
- func (r *RepositoryLicense) GetType() string
- func (r *RepositoryLicense) GetURL() string
- func (l RepositoryLicense) String() string
- type RepositoryListAllOptions
- type RepositoryListByOrgOptions
- type RepositoryListForksOptions
- type RepositoryListOptions
- type RepositoryMergeRequest
- type RepositoryParticipation
- type RepositoryPermissionLevel
- type RepositoryRelease
- func (r *RepositoryRelease) GetAssetsURL() string
- func (r *RepositoryRelease) GetBody() string
- func (r *RepositoryRelease) GetCreatedAt() Timestamp
- func (r *RepositoryRelease) GetDraft() bool
- func (r *RepositoryRelease) GetHTMLURL() string
- func (r *RepositoryRelease) GetID() int
- func (r *RepositoryRelease) GetName() string
- func (r *RepositoryRelease) GetPrerelease() bool
- func (r *RepositoryRelease) GetPublishedAt() Timestamp
- func (r *RepositoryRelease) GetTagName() string
- func (r *RepositoryRelease) GetTarballURL() string
- func (r *RepositoryRelease) GetTargetCommitish() string
- func (r *RepositoryRelease) GetURL() string
- func (r *RepositoryRelease) GetUploadURL() string
- func (r *RepositoryRelease) GetZipballURL() string
- func (r RepositoryRelease) String() string
- type RepositoryTag
- type RequiredStatusChecks
- type Response
- type Reviewers
- type ReviewersRequest
- type Scope
- type SearchOptions
- type SearchService
- func (s *SearchService) Code(ctx context.Context, query string, opt *SearchOptions) (*CodeSearchResult, *Response, error)
- func (s *SearchService) Commits(ctx context.Context, query string, opt *SearchOptions) (*CommitsSearchResult, *Response, error)
- func (s *SearchService) Issues(ctx context.Context, query string, opt *SearchOptions) (*IssuesSearchResult, *Response, error)
- func (s *SearchService) Repositories(ctx context.Context, query string, opt *SearchOptions) (*RepositoriesSearchResult, *Response, error)
- func (s *SearchService) Users(ctx context.Context, query string, opt *SearchOptions) (*UsersSearchResult, *Response, error)
- type ServiceHook
- type SignatureVerification
- type Source
- type SourceImportAuthor
- func (s *SourceImportAuthor) GetEmail() string
- func (s *SourceImportAuthor) GetID() int
- func (s *SourceImportAuthor) GetImportURL() string
- func (s *SourceImportAuthor) GetName() string
- func (s *SourceImportAuthor) GetRemoteID() string
- func (s *SourceImportAuthor) GetRemoteName() string
- func (s *SourceImportAuthor) GetURL() string
- func (a SourceImportAuthor) String() string
- type Stargazer
- type StarredRepository
- type StatusEvent
- func (s *StatusEvent) GetContext() string
- func (s *StatusEvent) GetCreatedAt() Timestamp
- func (s *StatusEvent) GetDescription() string
- func (s *StatusEvent) GetID() int
- func (s *StatusEvent) GetName() string
- func (s *StatusEvent) GetSHA() string
- func (s *StatusEvent) GetState() string
- func (s *StatusEvent) GetTargetURL() string
- func (s *StatusEvent) GetUpdatedAt() Timestamp
- type Subscription
- func (s *Subscription) GetCreatedAt() Timestamp
- func (s *Subscription) GetIgnored() bool
- func (s *Subscription) GetReason() string
- func (s *Subscription) GetRepositoryURL() string
- func (s *Subscription) GetSubscribed() bool
- func (s *Subscription) GetThreadURL() string
- func (s *Subscription) GetURL() string
- type Tag
- type Team
- func (t *Team) GetDescription() string
- func (t *Team) GetID() int
- func (t *Team) GetLDAPDN() string
- func (t *Team) GetMembersCount() int
- func (t *Team) GetMembersURL() string
- func (t *Team) GetName() string
- func (t *Team) GetPermission() string
- func (t *Team) GetPrivacy() string
- func (t *Team) GetReposCount() int
- func (t *Team) GetRepositoriesURL() string
- func (t *Team) GetSlug() string
- func (t *Team) GetURL() string
- func (t Team) String() string
- type TeamAddEvent
- type TeamChange
- type TeamEvent
- type TeamLDAPMapping
- func (t *TeamLDAPMapping) GetDescription() string
- func (t *TeamLDAPMapping) GetID() int
- func (t *TeamLDAPMapping) GetLDAPDN() string
- func (t *TeamLDAPMapping) GetMembersURL() string
- func (t *TeamLDAPMapping) GetName() string
- func (t *TeamLDAPMapping) GetPermission() string
- func (t *TeamLDAPMapping) GetPrivacy() string
- func (t *TeamLDAPMapping) GetRepositoriesURL() string
- func (t *TeamLDAPMapping) GetSlug() string
- func (t *TeamLDAPMapping) GetURL() string
- func (m TeamLDAPMapping) String() string
- type TextMatch
- type Timeline
- type Timestamp
- type Topics
- type TrafficBreakdownOptions
- type TrafficClones
- type TrafficData
- type TrafficPath
- type TrafficReferrer
- type TrafficViews
- type Tree
- type TreeEntry
- type TwoFactorAuthError
- type UnauthenticatedRateLimitedTransport
- type UploadOptions
- type User
- func (u *User) GetAvatarURL() string
- func (u *User) GetBio() string
- func (u *User) GetBlog() string
- func (u *User) GetCollaborators() int
- func (u *User) GetCompany() string
- func (u *User) GetCreatedAt() Timestamp
- func (u *User) GetDiskUsage() int
- func (u *User) GetEmail() string
- func (u *User) GetEventsURL() string
- func (u *User) GetFollowers() int
- func (u *User) GetFollowersURL() string
- func (u *User) GetFollowing() int
- func (u *User) GetFollowingURL() string
- func (u *User) GetGistsURL() string
- func (u *User) GetGravatarID() string
- func (u *User) GetHTMLURL() string
- func (u *User) GetHireable() bool
- func (u *User) GetID() int
- func (u *User) GetLocation() *UserAddress
- func (u *User) GetLogin() string
- func (u *User) GetName() string
- func (u *User) GetOrganizationsURL() string
- func (u *User) GetOwnedPrivateRepos() int
- func (u *User) GetPermissions() map[string]bool
- func (u *User) GetPrivateGists() int
- func (u *User) GetPublicGists() int
- func (u *User) GetPublicRepos() int
- func (u *User) GetReceivedEventsURL() string
- func (u *User) GetReposURL() string
- func (u *User) GetSiteAdmin() bool
- func (u *User) GetStarredURL() string
- func (u *User) GetSubscriptionsURL() string
- func (u *User) GetSuspendedAt() Timestamp
- func (u *User) GetTotalPrivateRepos() int
- func (u *User) GetType() string
- func (u *User) GetURL() string
- func (u *User) GetUpdatedAt() Timestamp
- func (u User) String() string
- type UserAddress
- type UserEmail
- type UserLDAPMapping
- func (u *UserLDAPMapping) GetAvatarURL() string
- func (u *UserLDAPMapping) GetEventsURL() string
- func (u *UserLDAPMapping) GetFollowersURL() string
- func (u *UserLDAPMapping) GetFollowingURL() string
- func (u *UserLDAPMapping) GetGistsURL() string
- func (u *UserLDAPMapping) GetGravatarID() string
- func (u *UserLDAPMapping) GetID() int
- func (u *UserLDAPMapping) GetLDAPDN() string
- func (u *UserLDAPMapping) GetLogin() string
- func (u *UserLDAPMapping) GetOrganizationsURL() string
- func (u *UserLDAPMapping) GetReceivedEventsURL() string
- func (u *UserLDAPMapping) GetReposURL() string
- func (u *UserLDAPMapping) GetSiteAdmin() bool
- func (u *UserLDAPMapping) GetStarredURL() string
- func (u *UserLDAPMapping) GetSubscriptionsURL() string
- func (u *UserLDAPMapping) GetType() string
- func (u *UserLDAPMapping) GetURL() string
- func (m UserLDAPMapping) String() string
- type UserListOptions
- type UsersSearchResult
- type UsersService
- func (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int) (*Response, error)
- func (s *UsersService) AddEmail(ctx context.Context, email *UserEmail) (*UserEmail, *Response, error)
- func (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error)
- func (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error)
- func (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int) (*Response, error)
- func (s *UsersService) DeleteEmail(ctx context.Context) (bool, *Response, error)
- func (s *UsersService) DeleteGPGKey(ctx context.Context, id int) (*Response, error)
- func (s *UsersService) DeleteKey(ctx context.Context, id int) (*Response, error)
- func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error)
- func (s *UsersService) EditAddress(ctx context.Context, userAddress *UserAddress) (*User, *Response, error)
- func (s *UsersService) Follow(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error)
- func (s *UsersService) GetAddress(ctx context.Context) (*UserAddress, *Response, error)
- func (s *UsersService) GetByID(ctx context.Context, id int) (*User, *Response, error)
- func (s *UsersService) GetEmail(ctx context.Context) (*UserEmail, *Response, error)
- func (s *UsersService) GetGPGKey(ctx context.Context, id int) (*GPGKey, *Response, error)
- func (s *UsersService) GetKey(ctx context.Context, id int) (*Key, *Response, error)
- func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error)
- func (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error)
- func (s *UsersService) ListAll(ctx context.Context, opt *UserListOptions) ([]*User, *Response, error)
- func (s *UsersService) ListBlockedUsers(ctx context.Context, opt *ListOptions) ([]*User, *Response, error)
- func (s *UsersService) ListFollowers(ctx context.Context, user string, opt *ListOptions) ([]*User, *Response, error)
- func (s *UsersService) ListFollowing(ctx context.Context, user string, opt *ListOptions) ([]*User, *Response, error)
- func (s *UsersService) ListGPGKeys(ctx context.Context, user string, opt *ListOptions) ([]*GPGKey, *Response, error)
- func (s *UsersService) ListInvitations(ctx context.Context, opt *ListOptions) ([]*RepositoryInvitation, *Response, error)
- func (s *UsersService) ListKeys(ctx context.Context, opt *ListOptions) ([]*Key, *Response, error)
- func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) Suspend(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error)
- func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error)
- type WatchEvent
- type WebHookAuthor
- type WebHookCommit
- type WebHookPayload
- func (w *WebHookPayload) GetAfter() string
- func (w *WebHookPayload) GetBefore() string
- func (w *WebHookPayload) GetCompare() string
- func (w *WebHookPayload) GetCreated() bool
- func (w *WebHookPayload) GetDeleted() bool
- func (w *WebHookPayload) GetForced() bool
- func (w *WebHookPayload) GetRef() string
- func (w WebHookPayload) String() string
- type WeeklyCommitActivity
- type WeeklyStats
Constants ¶
const ( // Tarball specifies an archive in gzipped tar format. Tarball archiveFormat = "tarball" // Zipball specifies an archive in zip format. Zipball archiveFormat = "zipball" )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range or equal to 202 Accepted. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.
The error type will be *RateLimitError for rate limit exceeded errors, *AcceptedError for 202 Accepted status codes, and *TwoFactorAuthError for two-factor authentication errors.
func DeliveryID ¶
DeliveryID returns the unique delivery ID of webhook request r.
GitHub API docs: https://developer.github.com/v3/repos/hooks/#webhook-headers
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
func ParseWebHook ¶
ParseWebHook parses the event payload. For recognized event types, a value of the corresponding struct type will be returned (as returned by Event.ParsePayload()). An error will be returned for unrecognized event types.
Example usage:
func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { payload, err := github.ValidatePayload(r, s.webhookSecretKey) if err != nil { ... } event, err := github.ParseWebHook(github.WebHookType(r), payload) if err != nil { ... } switch event := event.(type) { case *github.CommitCommentEvent: processCommitCommentEvent(event) case *github.CreateEvent: processCreateEvent(event) ... } }
func String ¶
String is a helper routine that allocates a new string value to store v and returns a pointer to it.
func Stringify ¶
func Stringify(message interface{}) string
Stringify attempts to create a reasonable string representation of types in the GitHub library. It does things like resolve pointers to their values and omits struct fields with nil values.
func ValidatePayload ¶
ValidatePayload validates an incoming GitHub Webhook event request and returns the (JSON) payload. The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". If the Content-Type is neither then an error is returned. secretKey is the GitHub Webhook secret message.
Example usage:
func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { payload, err := github.ValidatePayload(r, s.webhookSecretKey) if err != nil { ... } // Process payload... }
func WebHookType ¶
WebHookType returns the event type of webhook request r.
GitHub API docs: https://developer.github.com/v3/repos/hooks/#webhook-headers
Types ¶
type APIMeta ¶
type APIMeta struct { // An Array of IP addresses in CIDR format specifying the addresses // that incoming service hooks will originate from on GitHub.com. Hooks []string `json:"hooks,omitempty"` // An Array of IP addresses in CIDR format specifying the Git servers // for GitHub.com. Git []string `json:"git,omitempty"` // Whether authentication with username and password is supported. // (GitHub Enterprise instances using CAS or OAuth for authentication // will return false. Features like Basic Authentication with a // username and password, sudo mode, and two-factor authentication are // not supported on these servers.) VerifiablePasswordAuthentication *bool `json:"verifiable_password_authentication,omitempty"` // An array of IP addresses in CIDR format specifying the addresses // which serve GitHub Pages websites. Pages []string `json:"pages,omitempty"` }
APIMeta represents metadata about the GitHub API.
func (*APIMeta) GetVerifiablePasswordAuthentication ¶
GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise.
type AbuseRateLimitError ¶
type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message // RetryAfter is provided with some abuse rate limit errors. If present, // it is the amount of time that the client should wait before retrying. // Otherwise, the client should try again later (after an unspecified amount of time). RetryAfter *time.Duration }
AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the "documentation_url" field value equal to "https://developer.github.com/v3#abuse-rate-limits".
func (*AbuseRateLimitError) Error ¶
func (r *AbuseRateLimitError) Error() string
func (*AbuseRateLimitError) GetRetryAfter ¶
func (a *AbuseRateLimitError) GetRetryAfter() time.Duration
GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise.
type AcceptedError ¶
type AcceptedError struct{}
AcceptedError occurs when GitHub returns 202 Accepted response with an empty body, which means a job was scheduled on the GitHub side to process the information needed and cache it. Technically, 202 Accepted is not a real error, it's just used to indicate that results are not ready yet, but should be available soon. The request can be repeated after some time.
func (*AcceptedError) Error ¶
func (*AcceptedError) Error() string
type ActivityListStarredOptions ¶
type ActivityListStarredOptions struct { // How to sort the repository list. Possible values are: created, updated, // pushed, full_name. Default is "full_name". Sort string `url:"sort,omitempty"` // Direction in which to sort repositories. Possible values are: asc, desc. // Default is "asc" when sort is "full_name", otherwise default is "desc". Direction string `url:"direction,omitempty"` ListOptions }
ActivityListStarredOptions specifies the optional parameters to the ActivityService.ListStarred method.
type ActivityService ¶
type ActivityService service
ActivityService handles communication with the activity related methods of the GitHub API.
GitHub API docs: https://developer.github.com/v3/activity/
func (*ActivityService) DeleteRepositorySubscription ¶
func (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error)
DeleteRepositorySubscription deletes the subscription for the specified repository for the authenticated user.
This is used to stop watching a repository. To control whether or not to receive notifications from a repository, use SetRepositorySubscription.
GitHub API docs: https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription
func (*ActivityService) DeleteThreadSubscription ¶
func (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error)
DeleteThreadSubscription deletes the subscription for the specified thread for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription
func (*ActivityService) GetRepositorySubscription ¶
func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (bool, *Response, error)
GetRepositorySubscription returns the subscription for the specified repository for the authenticated user. If the authenticated user is not watching the repository, a nil Subscription is returned.
GitHub API docs: https://developer.github.com/v3/activity/watching/#get-a-repository-subscription
func (*ActivityService) GetThread ¶
func (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error)
GetThread gets the specified notification thread.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#view-a-single-thread
func (*ActivityService) GetThreadSubscription ¶
func (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error)
GetThreadSubscription checks to see if the authenticated user is subscribed to a thread.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription
func (*ActivityService) IsStarred ¶
func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error)
IsStarred checks if a repository is starred by authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
func (*ActivityService) ListEvents ¶
func (s *ActivityService) ListEvents(ctx context.Context, opt *ListOptions) ([]*Event, *Response, error)
ListEvents drinks from the firehose of all public events across GitHub.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events
func (*ActivityService) ListEventsForOrganization ¶
func (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opt *ListOptions) ([]*Event, *Response, error)
ListEventsForOrganization lists public events for an organization.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization
func (*ActivityService) ListEventsForRepoNetwork ¶
func (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error)
ListEventsForRepoNetwork lists public events for a network of repositories.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories
func (*ActivityService) ListEventsPerformedByUser ¶
func (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opt *ListOptions) ([]*Event, *Response, error)
ListEventsPerformedByUser lists the events performed by a user. If publicOnly is true, only public events will be returned.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user
func (*ActivityService) ListEventsReceivedByUser ¶
func (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opt *ListOptions) ([]*Event, *Response, error)
ListEventsReceivedByUser lists the events received by a user. If publicOnly is true, only public events will be returned.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received
func (*ActivityService) ListFeeds ¶
ListFeeds lists all the feeds available to the authenticated user.
GitHub provides several timeline resources in Atom format:
Timeline: The GitHub global public timeline User: The public timeline for any user, using URI template Current user public: The public timeline for the authenticated user Current user: The private timeline for the authenticated user Current user actor: The private timeline for activity created by the authenticated user Current user organizations: The private timeline for the organizations the authenticated user is a member of.
Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.
func (*ActivityService) ListIssueEventsForRepository ¶
func (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error)
ListIssueEventsForRepository lists issue events for a repository.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository
func (*ActivityService) ListNotifications ¶
func (s *ActivityService) ListNotifications(ctx context.Context, opt *NotificationListOptions) ([]*Notification, *Response, error)
ListNotifications lists all notifications for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-your-notifications
func (*ActivityService) ListRepositoryEvents ¶
func (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Event, *Response, error)
ListRepositoryEvents lists events for a repository.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-repository-events
func (*ActivityService) ListRepositoryNotifications ¶
func (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opt *NotificationListOptions) ([]*Notification, *Response, error)
ListRepositoryNotifications lists all notifications in a given repository for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository
func (*ActivityService) ListStargazers ¶
func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opt *ListOptions) ([]*Stargazer, *Response, error)
ListStargazers lists people who have starred the specified repo.
GitHub API docs: https://developer.github.com/v3/activity/starring/#list-stargazers
func (*ActivityService) ListStarred ¶
func (s *ActivityService) ListStarred(ctx context.Context, user string, opt *ActivityListStarredOptions) ([]*StarredRepository, *Response, error)
ListStarred lists all the repos starred by a user. Passing the empty string will list the starred repositories for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
func (*ActivityService) ListUserEventsForOrganization ¶
func (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opt *ListOptions) ([]*Event, *Response, error)
ListUserEventsForOrganization provides the user’s organization dashboard. You must be authenticated as the user to view this.
GitHub API docs: https://developer.github.com/v3/activity/events/#list-events-for-an-organization
func (*ActivityService) ListWatched ¶
func (s *ActivityService) ListWatched(ctx context.Context, user string, opt *ListOptions) ([]*Repository, *Response, error)
ListWatched lists the repositories the specified user is watching. Passing the empty string will fetch watched repos for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched
func (*ActivityService) ListWatchers ¶
func (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opt *ListOptions) ([]*User, *Response, error)
ListWatchers lists watchers of a particular repo.
GitHub API docs: https://developer.github.com/v3/activity/watching/#list-watchers
func (*ActivityService) MarkNotificationsRead ¶
func (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead time.Time) (*Response, error)
MarkNotificationsRead marks all notifications up to lastRead as read.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#mark-as-read
func (*ActivityService) MarkRepositoryNotificationsRead ¶
func (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead time.Time) (*Response, error)
MarkRepositoryNotificationsRead marks all notifications up to lastRead in the specified repository as read.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository
func (*ActivityService) MarkThreadRead ¶
MarkThreadRead marks the specified thread as read.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read
func (*ActivityService) SetRepositorySubscription ¶
func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string) (bool, *Response, error)
SetRepositorySubscription sets the subscription for the specified repository for the authenticated user.
To watch a repository, set subscription.Subscribed to true. To ignore notifications made within a repository, set subscription.Ignored to true. To stop watching a repository, use DeleteRepositorySubscription.
GitHub API docs: https://developer.github.com/v3/activity/watching/#set-a-repository-subscription
func (*ActivityService) SetThreadSubscription ¶
func (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error)
SetThreadSubscription sets the subscription for the specified thread for the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription
func (*ActivityService) Star ¶
Star a repository as the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/starring/#star-a-repository
func (*ActivityService) Unstar ¶
Unstar a repository as the authenticated user.
GitHub API docs: https://developer.github.com/v3/activity/starring/#unstar-a-repository
type AdminEnforcement ¶
AdminEnforcement represents the configuration to enforce required status checks for repository administrators.
func (*AdminEnforcement) GetURL ¶
func (a *AdminEnforcement) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
type AdminService ¶
type AdminService service
AdminService handles communication with the admin related methods of the GitHub API. These API routes are normally only accessible for GitHub Enterprise installations.
GitHub API docs: https://developer.github.com/v3/enterprise/
func (*AdminService) UpdateTeamLDAPMapping ¶
func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error)
UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.
GitHub API docs: https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team
func (*AdminService) UpdateUserLDAPMapping ¶
func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error)
UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user.
GitHub API docs: https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user
type App ¶
type App struct { ID *int `json:"id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` ExternalURL *string `json:"external_url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
App represents a GitHub App.
func (*App) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*App) GetDescription ¶
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*App) GetExternalURL ¶
GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.
func (*App) GetHTMLURL ¶
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*App) GetUpdatedAt ¶
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
type AppsService ¶
type AppsService service
AppsService provides access to the installation related functions in the GitHub API.
GitHub API docs: https://developer.github.com/v3/apps/
func (*AppsService) AddRepository ¶
func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int) (*Repository, *Response, error)
AddRepository adds a single repository to an installation.
GitHub API docs: https://developer.github.com/v3/apps/installations/#add-repository-to-installation
func (*AppsService) CreateInstallationToken ¶
func (s *AppsService) CreateInstallationToken(ctx context.Context, id int) (*InstallationToken, *Response, error)
CreateInstallationToken creates a new installation token.
GitHub API docs: https://developer.github.com/v3/apps/#create-a-new-installation-token
func (*AppsService) Get ¶
Get a single GitHub App. Passing the empty string will get the authenticated GitHub App.
Note: appSlug is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., https://github.com/settings/apps/:app_slug).
GitHub API docs: https://developer.github.com/v3/apps/#get-a-single-github-app
func (*AppsService) GetInstallation ¶
func (s *AppsService) GetInstallation(ctx context.Context, id int) (*Installation, *Response, error)
GetInstallation returns the specified installation.
GitHub API docs: https://developer.github.com/v3/apps/#get-a-single-installation
func (*AppsService) ListInstallations ¶
func (s *AppsService) ListInstallations(ctx context.Context, opt *ListOptions) ([]*Installation, *Response, error)
ListInstallations lists the installations that the current GitHub App has.
GitHub API docs: https://developer.github.com/v3/apps/#find-installations
func (*AppsService) ListRepos ¶
func (s *AppsService) ListRepos(ctx context.Context, opt *ListOptions) ([]*Repository, *Response, error)
ListRepos lists the repositories that are accessible to the authenticated installation.
GitHub API docs: https://developer.github.com/v3/apps/installations/#list-repositories
func (*AppsService) ListUserInstallations ¶
func (s *AppsService) ListUserInstallations(ctx context.Context, opt *ListOptions) ([]*Installation, *Response, error)
ListUserInstallations lists installations that are accessible to the authenticated user.
GitHub API docs: https://developer.github.com/v3/apps/#list-installations-for-user
func (*AppsService) ListUserRepos ¶
func (s *AppsService) ListUserRepos(ctx context.Context, id int, opt *ListOptions) ([]*Repository, *Response, error)
ListUserRepos lists repositories that are accessible to the authenticated user for an installation.
GitHub API docs: https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation
func (*AppsService) RemoveRepository ¶
RemoveRepository removes a single repository from an installation.
GitHub docs: https://developer.github.com/v3/apps/installations/#remove-repository-from-installation
type Authorization ¶
type Authorization struct { ID *int `json:"id,omitempty"` URL *string `json:"url,omitempty"` Scopes []Scope `json:"scopes,omitempty"` Token *string `json:"token,omitempty"` TokenLastEight *string `json:"token_last_eight,omitempty"` HashedToken *string `json:"hashed_token,omitempty"` App *AuthorizationApp `json:"app,omitempty"` Note *string `json:"note,omitempty"` NoteURL *string `json:"note_url,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` Fingerprint *string `json:"fingerprint,omitempty"` // User is only populated by the Check and Reset methods. User *User `json:"user,omitempty"` }
Authorization represents an individual GitHub authorization.
func (*Authorization) GetCreatedAt ¶
func (a *Authorization) GetCreatedAt() Timestamp
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Authorization) GetFingerprint ¶
func (a *Authorization) GetFingerprint() string
GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.
func (*Authorization) GetHashedToken ¶
func (a *Authorization) GetHashedToken() string
GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.
func (*Authorization) GetID ¶
func (a *Authorization) GetID() int
GetID returns the ID field if it's non-nil, zero value otherwise.
func (*Authorization) GetNote ¶
func (a *Authorization) GetNote() string
GetNote returns the Note field if it's non-nil, zero value otherwise.
func (*Authorization) GetNoteURL ¶
func (a *Authorization) GetNoteURL() string
GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.
func (*Authorization) GetToken ¶
func (a *Authorization) GetToken() string
GetToken returns the Token field if it's non-nil, zero value otherwise.
func (*Authorization) GetTokenLastEight ¶
func (a *Authorization) GetTokenLastEight() string
GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.
func (*Authorization) GetURL ¶
func (a *Authorization) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
func (*Authorization) GetUpdatedAt ¶
func (a *Authorization) GetUpdatedAt() Timestamp
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
func (Authorization) String ¶
func (a Authorization) String() string
type AuthorizationApp ¶
type AuthorizationApp struct { URL *string `json:"url,omitempty"` Name *string `json:"name,omitempty"` ClientID *string `json:"client_id,omitempty"` }
AuthorizationApp represents an individual GitHub app (in the context of authorization).
func (*AuthorizationApp) GetClientID ¶
func (a *AuthorizationApp) GetClientID() string
GetClientID returns the ClientID field if it's non-nil, zero value otherwise.
func (*AuthorizationApp) GetName ¶
func (a *AuthorizationApp) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*AuthorizationApp) GetURL ¶
func (a *AuthorizationApp) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
func (AuthorizationApp) String ¶
func (a AuthorizationApp) String() string
type AuthorizationRequest ¶
type AuthorizationRequest struct { Scopes []Scope `json:"scopes,omitempty"` Note *string `json:"note,omitempty"` NoteURL *string `json:"note_url,omitempty"` ClientID *string `json:"client_id,omitempty"` ClientSecret *string `json:"client_secret,omitempty"` Fingerprint *string `json:"fingerprint,omitempty"` }
AuthorizationRequest represents a request to create an authorization.
func (*AuthorizationRequest) GetClientID ¶
func (a *AuthorizationRequest) GetClientID() string
GetClientID returns the ClientID field if it's non-nil, zero value otherwise.
func (*AuthorizationRequest) GetClientSecret ¶
func (a *AuthorizationRequest) GetClientSecret() string
GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.
func (*AuthorizationRequest) GetFingerprint ¶
func (a *AuthorizationRequest) GetFingerprint() string
GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.
func (*AuthorizationRequest) GetNote ¶
func (a *AuthorizationRequest) GetNote() string
GetNote returns the Note field if it's non-nil, zero value otherwise.
func (*AuthorizationRequest) GetNoteURL ¶
func (a *AuthorizationRequest) GetNoteURL() string
GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.
func (AuthorizationRequest) String ¶
func (a AuthorizationRequest) String() string
type AuthorizationUpdateRequest ¶
type AuthorizationUpdateRequest struct { Scopes []string `json:"scopes,omitempty"` AddScopes []string `json:"add_scopes,omitempty"` RemoveScopes []string `json:"remove_scopes,omitempty"` Note *string `json:"note,omitempty"` NoteURL *string `json:"note_url,omitempty"` Fingerprint *string `json:"fingerprint,omitempty"` }
AuthorizationUpdateRequest represents a request to update an authorization.
Note that for any one update, you must only provide one of the "scopes" fields. That is, you may provide only one of "Scopes", or "AddScopes", or "RemoveScopes".
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization
func (*AuthorizationUpdateRequest) GetFingerprint ¶
func (a *AuthorizationUpdateRequest) GetFingerprint() string
GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.
func (*AuthorizationUpdateRequest) GetNote ¶
func (a *AuthorizationUpdateRequest) GetNote() string
GetNote returns the Note field if it's non-nil, zero value otherwise.
func (*AuthorizationUpdateRequest) GetNoteURL ¶
func (a *AuthorizationUpdateRequest) GetNoteURL() string
GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.
func (AuthorizationUpdateRequest) String ¶
func (a AuthorizationUpdateRequest) String() string
type AuthorizationsService ¶
type AuthorizationsService service
AuthorizationsService handles communication with the authorization related methods of the GitHub API.
This service requires HTTP Basic Authentication; it cannot be accessed using an OAuth token.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/
func (*AuthorizationsService) Check ¶
func (s *AuthorizationsService) Check(ctx context.Context, clientID string, token string) (*Authorization, *Response, error)
Check if an OAuth token is valid for a specific app.
Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.
The returned Authorization.User field will be populated.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#check-an-authorization
func (*AuthorizationsService) Create ¶
func (s *AuthorizationsService) Create(ctx context.Context, auth *AuthorizationRequest) (*Authorization, *Response, error)
Create a new authorization for the specified OAuth application.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization
func (*AuthorizationsService) CreateImpersonation ¶
func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error)
CreateImpersonation creates an impersonation OAuth token.
This requires admin permissions. With the returned Authorization.Token you can e.g. create or delete a user's public SSH key. NOTE: creating a new token automatically revokes an existing one.
GitHub API docs: https://developer.github.com/enterprise/2.5/v3/users/administration/#create-an-impersonation-oauth-token
func (*AuthorizationsService) Delete ¶
Delete a single authorization.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization
func (*AuthorizationsService) DeleteGrant ¶
DeleteGrant deletes an OAuth application grant. Deleting an application's grant will also delete all OAuth tokens associated with the application for the user.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#delete-a-grant
func (*AuthorizationsService) DeleteImpersonation ¶
func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error)
DeleteImpersonation deletes an impersonation OAuth token.
NOTE: there can be only one at a time.
GitHub API docs: https://developer.github.com/enterprise/2.5/v3/users/administration/#delete-an-impersonation-oauth-token
func (*AuthorizationsService) Edit ¶
func (s *AuthorizationsService) Edit(ctx context.Context, id int, auth *AuthorizationUpdateRequest) (*Authorization, *Response, error)
Edit a single authorization.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization
func (*AuthorizationsService) Get ¶
func (s *AuthorizationsService) Get(ctx context.Context, id int) (*Authorization, *Response, error)
Get a single authorization.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization
func (*AuthorizationsService) GetGrant ¶
GetGrant gets a single OAuth application grant.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant
func (*AuthorizationsService) GetOrCreateForApp ¶
func (s *AuthorizationsService) GetOrCreateForApp(ctx context.Context, clientID string, auth *AuthorizationRequest) (*Authorization, *Response, error)
GetOrCreateForApp creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user.
If a new token is created, the HTTP status code will be "201 Created", and the returned Authorization.Token field will be populated. If an existing token is returned, the status code will be "200 OK" and the Authorization.Token field will be empty.
clientID is the OAuth Client ID with which to create the token.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint
func (*AuthorizationsService) List ¶
func (s *AuthorizationsService) List(ctx context.Context, opt *ListOptions) ([]*Authorization, *Response, error)
List the authorizations for the authenticated user.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations
func (*AuthorizationsService) ListGrants ¶
func (s *AuthorizationsService) ListGrants(ctx context.Context, opt *ListOptions) ([]*Grant, *Response, error)
ListGrants lists the set of OAuth applications that have been granted access to a user's account. This will return one entry for each application that has been granted access to the account, regardless of the number of tokens an application has generated for the user.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#list-your-grants
func (*AuthorizationsService) Reset ¶
func (s *AuthorizationsService) Reset(ctx context.Context, clientID string, token string) (*Authorization, *Response, error)
Reset is used to reset a valid OAuth token without end user involvement. Applications must save the "token" property in the response, because changes take effect immediately.
Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.
The returned Authorization.User field will be populated.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization
func (*AuthorizationsService) Revoke ¶
func (s *AuthorizationsService) Revoke(ctx context.Context, clientID string, token string) (*Response, error)
Revoke an authorization for an application.
Note that this operation requires the use of BasicAuth, but where the username is the OAuth application clientID, and the password is its clientSecret. Invalid tokens will return a 404 Not Found.
GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application
type BasicAuthTransport ¶
type BasicAuthTransport struct { Username string // GitHub username Password string // GitHub password OTP string // one-time password for users with two-factor auth enabled ClientID string ClientSecret string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password. It additionally supports users who have two-factor authentication enabled on their GitHub account.
func (*BasicAuthTransport) Client ¶
func (t *BasicAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.
type Blob ¶
type Blob struct { Content *string `json:"content,omitempty"` Encoding *string `json:"encoding,omitempty"` SHA *string `json:"sha,omitempty"` Size *int `json:"size,omitempty"` URL *string `json:"url,omitempty"` }
Blob represents a blob object.
func (*Blob) GetContent ¶
GetContent returns the Content field if it's non-nil, zero value otherwise.
func (*Blob) GetEncoding ¶
GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.
type Branch ¶
type Branch struct { Name *string `json:"name,omitempty"` Commit *RepositoryCommit `json:"commit,omitempty"` Protected *bool `json:"protected,omitempty"` }
Branch represents a repository branch
func (*Branch) GetProtected ¶
GetProtected returns the Protected field if it's non-nil, zero value otherwise.
type BranchRestrictions ¶
type BranchRestrictions struct { // The list of user logins with push access. Users []*User `json:"users"` // The list of team slugs with push access. Teams []*Team `json:"teams"` }
BranchRestrictions represents the restriction that only certain users or teams may push to a branch.
type BranchRestrictionsRequest ¶
type BranchRestrictionsRequest struct { // The list of user logins with push access. (Required; use []string{} instead of nil for empty list.) Users []string `json:"users"` // The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.) Teams []string `json:"teams"` }
BranchRestrictionsRequest represents the request to create/edit the restriction that only certain users or teams may push to a branch. It is separate from BranchRestrictions above because the request structure is different from the response structure.
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public GitHub API, but can be // set to a domain endpoint to use with GitHub Enterprise. BaseURL should // always be specified with a trailing slash. BaseURL *url.URL // Base URL for uploading files. UploadURL *url.URL // User agent used when communicating with the GitHub API. UserAgent string // Services used for talking to different parts of the GitHub API. Activity *ActivityService Gists *GistsService Git *GitService Issues *IssuesService // TODO Labels // TODO Milestones // TODO Miscellaneous Organizations *OrganizationsService PullRequests *PullRequestsService Repositories *RepositoriesService Users *UsersService // Admin *AdminService // Apps *AppsService Authorizations *AuthorizationsService // contains filtered or unexported fields }
A Client manages communication with the GitHub API.
func NewClient ¶
NewClient returns a new GitHub API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).
func NewEnterpriseClient ¶
NewEnterpriseClient returns a new GitHub API client with provided base URL and upload URL (often the same URL). If either URL does not have a trailing slash, one is added automatically. If a nil httpClient is provided, http.DefaultClient will be used.
Note that NewEnterpriseClient is a convenience helper only; its behavior is equivalent to using NewClient, followed by setting the BaseURL and UploadURL fields.
func (*Client) APIMeta ¶
APIMeta returns information about GitHub.com, the service. Or, if you access this endpoint on your organization’s GitHub Enterprise installation, this endpoint provides information about that installation.
GitHub API docs: https://developer.github.com/v3/meta/
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.
The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.
func (*Client) GetCodeOfConduct ¶
func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error)
GetCodeOfConduct returns an individual code of conduct.
https://developer.github.com/v3/codes_of_conduct/#get-an-individual-code-of-conduct
func (*Client) ListCodesOfConduct ¶
ListCodesOfConduct returns all codes of conduct.
GitHub API docs: https://developer.github.com/v3/codes_of_conduct/#list-all-codes-of-conduct
func (*Client) ListEmojis ¶
ListEmojis returns the emojis available to use on GitHub.
GitHub API docs: https://developer.github.com/v3/emojis/
func (*Client) ListServiceHooks ¶
ListServiceHooks lists all of the available service hooks.
GitHub API docs: https://developer.github.com/webhooks/#services
func (*Client) Markdown ¶
func (c *Client) Markdown(ctx context.Context, text string, opt *MarkdownOptions) (string, *Response, error)
Markdown renders an arbitrary Markdown document.
GitHub API docs: https://developer.github.com/v3/markdown/
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
func (*Client) NewUploadRequest ¶
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error)
NewUploadRequest creates an upload request. A relative URL can be provided in urlStr, in which case it is resolved relative to the UploadURL of the Client. Relative URLs should always be specified without a preceding slash.
func (*Client) Octocat ¶
Octocat returns an ASCII art octocat with the specified message in a speech bubble. If message is empty, a random zen phrase is used.
func (*Client) RateLimits ¶
RateLimits returns the rate limits for the current client.
type CodeOfConduct ¶
type CodeOfConduct struct { Name *string `json:"name,omitempty"` Key *string `json:"key,omitempty"` URL *string `json:"url,omitempty"` Body *string `json:"body,omitempty"` }
CodeOfConduct represents a code of conduct.
func (*CodeOfConduct) GetBody ¶
func (c *CodeOfConduct) GetBody() string
GetBody returns the Body field if it's non-nil, zero value otherwise.
func (*CodeOfConduct) GetKey ¶
func (c *CodeOfConduct) GetKey() string
GetKey returns the Key field if it's non-nil, zero value otherwise.
func (*CodeOfConduct) GetName ¶
func (c *CodeOfConduct) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*CodeOfConduct) GetURL ¶
func (c *CodeOfConduct) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
func (*CodeOfConduct) String ¶
func (c *CodeOfConduct) String() string
type CodeResult ¶
type CodeResult struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` SHA *string `json:"sha,omitempty"` HTMLURL *string `json:"html_url,omitempty"` Repository *Repository `json:"repository,omitempty"` TextMatches []TextMatch `json:"text_matches,omitempty"` }
CodeResult represents a single search result.
func (*CodeResult) GetHTMLURL ¶
func (c *CodeResult) GetHTMLURL() string
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*CodeResult) GetName ¶
func (c *CodeResult) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*CodeResult) GetPath ¶
func (c *CodeResult) GetPath() string
GetPath returns the Path field if it's non-nil, zero value otherwise.
func (*CodeResult) GetSHA ¶
func (c *CodeResult) GetSHA() string
GetSHA returns the SHA field if it's non-nil, zero value otherwise.
func (CodeResult) String ¶
func (c CodeResult) String() string
type CodeSearchResult ¶
type CodeSearchResult struct { Total *int `json:"total_count,omitempty"` IncompleteResults *bool `json:"incomplete_results,omitempty"` CodeResults []CodeResult `json:"items,omitempty"` }
CodeSearchResult represents the result of a code search.
func (*CodeSearchResult) GetIncompleteResults ¶
func (c *CodeSearchResult) GetIncompleteResults() bool
GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.
func (*CodeSearchResult) GetTotal ¶
func (c *CodeSearchResult) GetTotal() int
GetTotal returns the Total field if it's non-nil, zero value otherwise.
type CombinedStatus ¶
type CombinedStatus struct { // State is the combined state of the repository. Possible values are: // failure, pending, or success. State *string `json:"state,omitempty"` Name *string `json:"name,omitempty"` SHA *string `json:"sha,omitempty"` TotalCount *int `json:"total_count,omitempty"` Statuses []RepoStatus `json:"statuses,omitempty"` CommitURL *string `json:"commit_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` }
CombinedStatus represents the combined status of a repository at a particular reference.
func (*CombinedStatus) GetCommitURL ¶
func (c *CombinedStatus) GetCommitURL() string
GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.
func (*CombinedStatus) GetName ¶
func (c *CombinedStatus) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*CombinedStatus) GetRepositoryURL ¶
func (c *CombinedStatus) GetRepositoryURL() string
GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.
func (*CombinedStatus) GetSHA ¶
func (c *CombinedStatus) GetSHA() string
GetSHA returns the SHA field if it's non-nil, zero value otherwise.
func (*CombinedStatus) GetState ¶
func (c *CombinedStatus) GetState() string
GetState returns the State field if it's non-nil, zero value otherwise.
func (*CombinedStatus) GetTotalCount ¶
func (c *CombinedStatus) GetTotalCount() int
GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.
func (CombinedStatus) String ¶
func (s CombinedStatus) String() string
type Commit ¶
type Commit struct { SHA *string `json:"sha,omitempty"` Author *CommitAuthor `json:"author,omitempty"` Committer *CommitAuthor `json:"committer,omitempty"` Message *string `json:"message,omitempty"` Tree *Tree `json:"tree,omitempty"` Parents []Commit `json:"parents,omitempty"` Stats *CommitStats `json:"stats,omitempty"` HTMLURL *string `json:"html_url,omitempty"` URL *string `json:"url,omitempty"` Verification *SignatureVerification `json:"verification,omitempty"` // CommentCount is the number of GitHub comments on the commit. This // is only populated for requests that fetch GitHub data like // Pulls.ListCommits, Repositories.ListCommits, etc. CommentCount *int `json:"comment_count,omitempty"` }
Commit represents a GitHub commit.
func (*Commit) GetCommentCount ¶
GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.
func (*Commit) GetHTMLURL ¶
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*Commit) GetMessage ¶
GetMessage returns the Message field if it's non-nil, zero value otherwise.
type CommitAuthor ¶
type CommitAuthor struct { Date *time.Time `json:"date,omitempty"` Name *string `json:"name,omitempty"` Email *string `json:"email,omitempty"` // The following fields are only populated by Webhook events. Login *string `json:"username,omitempty"` // Renamed for go-github consistency. }
CommitAuthor represents the author or committer of a commit. The commit author may not correspond to a GitHub User.
func (*CommitAuthor) GetDate ¶
func (c *CommitAuthor) GetDate() time.Time
GetDate returns the Date field if it's non-nil, zero value otherwise.
func (*CommitAuthor) GetEmail ¶
func (c *CommitAuthor) GetEmail() string
GetEmail returns the Email field if it's non-nil, zero value otherwise.
func (*CommitAuthor) GetLogin ¶
func (c *CommitAuthor) GetLogin() string
GetLogin returns the Login field if it's non-nil, zero value otherwise.
func (*CommitAuthor) GetName ¶
func (c *CommitAuthor) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (CommitAuthor) String ¶
func (c CommitAuthor) String() string
type CommitCommentEvent ¶
type CommitCommentEvent struct { Comment *RepositoryComment `json:"comment,omitempty"` // The following fields are only populated by Webhook events. Action *string `json:"action,omitempty"` Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` }
CommitCommentEvent is triggered when a commit comment is created. The Webhook event name is "commit_comment".
GitHub API docs: https://developer.github.com/v3/activity/events/types/#commitcommentevent
func (*CommitCommentEvent) GetAction ¶
func (c *CommitCommentEvent) GetAction() string
GetAction returns the Action field if it's non-nil, zero value otherwise.
type CommitFile ¶
type CommitFile struct { SHA *string `json:"sha,omitempty"` Filename *string `json:"filename,omitempty"` Additions *int `json:"additions,omitempty"` Deletions *int `json:"deletions,omitempty"` Changes *int `json:"changes,omitempty"` Status *string `json:"status,omitempty"` Patch *string `json:"patch,omitempty"` BlobURL *string `json:"blob_url,omitempty"` RawURL *string `json:"raw_url,omitempty"` ContentsURL *string `json:"contents_url,omitempty"` }
CommitFile represents a file modified in a commit.
func (*CommitFile) GetAdditions ¶
func (c *CommitFile) GetAdditions() int
GetAdditions returns the Additions field if it's non-nil, zero value otherwise.
func (*CommitFile) GetBlobURL ¶
func (c *CommitFile) GetBlobURL() string
GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.
func (*CommitFile) GetChanges ¶
func (c *CommitFile) GetChanges() int
GetChanges returns the Changes field if it's non-nil, zero value otherwise.
func (*CommitFile) GetContentsURL ¶
func (c *CommitFile) GetContentsURL() string
GetContentsURL returns the ContentsURL field if it's non-nil, zero value otherwise.
func (*CommitFile) GetDeletions ¶
func (c *CommitFile) GetDeletions() int
GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.
func (*CommitFile) GetFilename ¶
func (c *CommitFile) GetFilename() string
GetFilename returns the Filename field if it's non-nil, zero value otherwise.
func (*CommitFile) GetPatch ¶
func (c *CommitFile) GetPatch() string
GetPatch returns the Patch field if it's non-nil, zero value otherwise.
func (*CommitFile) GetRawURL ¶
func (c *CommitFile) GetRawURL() string
GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.
func (*CommitFile) GetSHA ¶
func (c *CommitFile) GetSHA() string
GetSHA returns the SHA field if it's non-nil, zero value otherwise.
func (*CommitFile) GetStatus ¶
func (c *CommitFile) GetStatus() string
GetStatus returns the Status field if it's non-nil, zero value otherwise.
func (CommitFile) String ¶
func (c CommitFile) String() string
type CommitResult ¶
type CommitResult struct { SHA *string `json:"sha,omitempty"` Commit *Commit `json:"commit,omitempty"` Author *User `json:"author,omitempty"` Committer *User `json:"committer,omitempty"` Parents []*Commit `json:"parents,omitempty"` HTMLURL *string `json:"html_url,omitempty"` URL *string `json:"url,omitempty"` CommentsURL *string `json:"comments_url,omitempty"` Repository *Repository `json:"repository,omitempty"` Score *float64 `json:"score,omitempty"` }
CommitResult represents a commit object as returned in commit search endpoint response.
func (*CommitResult) GetCommentsURL ¶
func (c *CommitResult) GetCommentsURL() string
GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.
func (*CommitResult) GetHTMLURL ¶
func (c *CommitResult) GetHTMLURL() string
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*CommitResult) GetSHA ¶
func (c *CommitResult) GetSHA() string
GetSHA returns the SHA field if it's non-nil, zero value otherwise.
func (*CommitResult) GetURL ¶
func (c *CommitResult) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
type CommitStats ¶
type CommitStats struct { Additions *int `json:"additions,omitempty"` Deletions *int `json:"deletions,omitempty"` Total *int `json:"total,omitempty"` }
CommitStats represents the number of additions / deletions from a file in a given RepositoryCommit or GistCommit.
func (*CommitStats) GetAdditions ¶
func (c *CommitStats) GetAdditions() int
GetAdditions returns the Additions field if it's non-nil, zero value otherwise.
func (*CommitStats) GetDeletions ¶
func (c *CommitStats) GetDeletions() int
GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.
func (*CommitStats) GetTotal ¶
func (c *CommitStats) GetTotal() int
GetTotal returns the Total field if it's non-nil, zero value otherwise.
func (CommitStats) String ¶
func (c CommitStats) String() string
type CommitsComparison ¶
type CommitsComparison struct { BaseCommit *RepositoryCommit `json:"base_commit,omitempty"` MergeBaseCommit *RepositoryCommit `json:"merge_base_commit,omitempty"` // Head can be 'behind' or 'ahead' Status *string `json:"status,omitempty"` AheadBy *int `json:"ahead_by,omitempty"` BehindBy *int `json:"behind_by,omitempty"` TotalCommits *int `json:"total_commits,omitempty"` Commits []RepositoryCommit `json:"commits,omitempty"` Files []CommitFile `json:"files,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PermalinkURL *string `json:"permalink_url,omitempty"` DiffURL *string `json:"diff_url,omitempty"` PatchURL *string `json:"patch_url,omitempty"` URL *string `json:"url,omitempty"` // API URL. }
CommitsComparison is the result of comparing two commits. See CompareCommits() for details.
func (*CommitsComparison) GetAheadBy ¶
func (c *CommitsComparison) GetAheadBy() int
GetAheadBy returns the AheadBy field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetBehindBy ¶
func (c *CommitsComparison) GetBehindBy() int
GetBehindBy returns the BehindBy field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetDiffURL ¶
func (c *CommitsComparison) GetDiffURL() string
GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetHTMLURL ¶
func (c *CommitsComparison) GetHTMLURL() string
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetPatchURL ¶
func (c *CommitsComparison) GetPatchURL() string
GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetPermalinkURL ¶
func (c *CommitsComparison) GetPermalinkURL() string
GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetStatus ¶
func (c *CommitsComparison) GetStatus() string
GetStatus returns the Status field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetTotalCommits ¶
func (c *CommitsComparison) GetTotalCommits() int
GetTotalCommits returns the TotalCommits field if it's non-nil, zero value otherwise.
func (*CommitsComparison) GetURL ¶
func (c *CommitsComparison) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
func (CommitsComparison) String ¶
func (c CommitsComparison) String() string
type CommitsListOptions ¶
type CommitsListOptions struct { // SHA or branch to start listing Commits from. SHA string `url:"sha,omitempty"` // Path that should be touched by the returned Commits. Path string `url:"path,omitempty"` // Author of by which to filter Commits. Author string `url:"author,omitempty"` // Since when should Commits be included in the response. Since time.Time `url:"since,omitempty"` // Until when should Commits be included in the response. Until time.Time `url:"until,omitempty"` ListOptions }
CommitsListOptions specifies the optional parameters to the RepositoriesService.ListCommits method.
type CommitsSearchResult ¶
type CommitsSearchResult struct { Total *int `json:"total_count,omitempty"` IncompleteResults *bool `json:"incomplete_results,omitempty"` Commits []*CommitResult `json:"items,omitempty"` }
CommitsSearchResult represents the result of a commits search.
func (*CommitsSearchResult) GetIncompleteResults ¶
func (c *CommitsSearchResult) GetIncompleteResults() bool
GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.
func (*CommitsSearchResult) GetTotal ¶
func (c *CommitsSearchResult) GetTotal() int
GetTotal returns the Total field if it's non-nil, zero value otherwise.
type CommunityHealthFiles ¶
type CommunityHealthFiles struct { CodeOfConduct *Metric `json:"code_of_conduct"` Contributing *Metric `json:"contributing"` License *Metric `json:"license"` Readme *Metric `json:"readme"` }
CommunityHealthFiles represents the different files in the community health metrics response.
type CommunityHealthMetrics ¶
type CommunityHealthMetrics struct { HealthPercentage *int `json:"health_percentage"` Files *CommunityHealthFiles `json:"files"` UpdatedAt *time.Time `json:"updated_at"` }
CommunityHealthMetrics represents a response containing the community metrics of a repository.
func (*CommunityHealthMetrics) GetHealthPercentage ¶
func (c *CommunityHealthMetrics) GetHealthPercentage() int
GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise.
func (*CommunityHealthMetrics) GetUpdatedAt ¶
func (c *CommunityHealthMetrics) GetUpdatedAt() time.Time
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
type Contributor ¶
type Contributor struct { Login *string `json:"login,omitempty"` ID *int `json:"id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` GravatarID *string `json:"gravatar_id,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` FollowersURL *string `json:"followers_url,omitempty"` FollowingURL *string `json:"following_url,omitempty"` GistsURL *string `json:"gists_url,omitempty"` StarredURL *string `json:"starred_url,omitempty"` SubscriptionsURL *string `json:"subscriptions_url,omitempty"` OrganizationsURL *string `json:"organizations_url,omitempty"` ReposURL *string `json:"repos_url,omitempty"` EventsURL *string `json:"events_url,omitempty"` ReceivedEventsURL *string `json:"received_events_url,omitempty"` Type *string `json:"type,omitempty"` SiteAdmin *bool `json:"site_admin"` Contributions *int `json:"contributions,omitempty"` }
Contributor represents a repository contributor
func (*Contributor) GetAvatarURL ¶
func (c *Contributor) GetAvatarURL() string
GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetContributions ¶
func (c *Contributor) GetContributions() int
GetContributions returns the Contributions field if it's non-nil, zero value otherwise.
func (*Contributor) GetEventsURL ¶
func (c *Contributor) GetEventsURL() string
GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetFollowersURL ¶
func (c *Contributor) GetFollowersURL() string
GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetFollowingURL ¶
func (c *Contributor) GetFollowingURL() string
GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetGistsURL ¶
func (c *Contributor) GetGistsURL() string
GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetGravatarID ¶
func (c *Contributor) GetGravatarID() string
GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.
func (*Contributor) GetHTMLURL ¶
func (c *Contributor) GetHTMLURL() string
GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetID ¶
func (c *Contributor) GetID() int
GetID returns the ID field if it's non-nil, zero value otherwise.
func (*Contributor) GetLogin ¶
func (c *Contributor) GetLogin() string
GetLogin returns the Login field if it's non-nil, zero value otherwise.
func (*Contributor) GetOrganizationsURL ¶
func (c *Contributor) GetOrganizationsURL() string
GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetReceivedEventsURL ¶
func (c *Contributor) GetReceivedEventsURL() string
GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetReposURL ¶
func (c *Contributor) GetReposURL() string
GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetSiteAdmin ¶
func (c *Contributor) GetSiteAdmin() bool
GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.
func (*Contributor) GetStarredURL ¶
func (c *Contributor) GetStarredURL() string
GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetSubscriptionsURL ¶
func (c *Contributor) GetSubscriptionsURL() string
GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.
func (*Contributor) GetType ¶
func (c *Contributor) GetType() string
GetType returns the Type field if it's non-nil, zero value otherwise.
func (*Contributor) GetURL ¶
func (c *Contributor) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
type ContributorStats ¶
type ContributorStats struct { Author *Contributor `json:"author,omitempty"` Total *int `json:"total,omitempty"` Weeks []WeeklyStats `json:"weeks,omitempty"` }
ContributorStats represents a contributor to a repository and their weekly contributions to a given repo.
func (*ContributorStats) GetTotal ¶
func (c *ContributorStats) GetTotal() int
GetTotal returns the Total field if it's non-nil, zero value otherwise.
func (ContributorStats) String ¶
func (c ContributorStats) String() string
type CreateEvent ¶
type CreateEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was created. Possible values are: "repository", "branch", "tag". RefType *string `json:"ref_type,omitempty"` MasterBranch *string `json:"master_branch,omitempty"` Description *string `json:"description,omitempty"` // The following fields are only populated by Webhook events. PusherType *string `json:"pusher_type,omitempty"` Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` }
CreateEvent represents a created repository, branch, or tag. The Webhook event name is "create".
Note: webhooks will not receive this event for created repositories. Additionally, webhooks will not receive this event for tags if more than three tags are pushed at once.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#createevent
func (*CreateEvent) GetDescription ¶
func (c *CreateEvent) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*CreateEvent) GetMasterBranch ¶
func (c *CreateEvent) GetMasterBranch() string
GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.
func (*CreateEvent) GetPusherType ¶
func (c *CreateEvent) GetPusherType() string
GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.
func (*CreateEvent) GetRef ¶
func (c *CreateEvent) GetRef() string
GetRef returns the Ref field if it's non-nil, zero value otherwise.
func (*CreateEvent) GetRefType ¶
func (c *CreateEvent) GetRefType() string
GetRefType returns the RefType field if it's non-nil, zero value otherwise.
type DeleteEvent ¶
type DeleteEvent struct { Ref *string `json:"ref,omitempty"` // RefType is the object that was deleted. Possible values are: "branch", "tag". RefType *string `json:"ref_type,omitempty"` // The following fields are only populated by Webhook events. PusherType *string `json:"pusher_type,omitempty"` Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` }
DeleteEvent represents a deleted branch or tag. The Webhook event name is "delete".
Note: webhooks will not receive this event for tags if more than three tags are deleted at once.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#deleteevent
func (*DeleteEvent) GetPusherType ¶
func (d *DeleteEvent) GetPusherType() string
GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.
func (*DeleteEvent) GetRef ¶
func (d *DeleteEvent) GetRef() string
GetRef returns the Ref field if it's non-nil, zero value otherwise.
func (*DeleteEvent) GetRefType ¶
func (d *DeleteEvent) GetRefType() string
GetRefType returns the RefType field if it's non-nil, zero value otherwise.
type Deployment ¶
type Deployment struct { URL *string `json:"url,omitempty"` ID *int `json:"id,omitempty"` SHA *string `json:"sha,omitempty"` Ref *string `json:"ref,omitempty"` Task *string `json:"task,omitempty"` Payload json.RawMessage `json:"payload,omitempty"` Environment *string `json:"environment,omitempty"` Description *string `json:"description,omitempty"` Creator *User `json:"creator,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` StatusesURL *string `json:"statuses_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` }
Deployment represents a deployment in a repo
func (*Deployment) GetCreatedAt ¶
func (d *Deployment) GetCreatedAt() Timestamp
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Deployment) GetDescription ¶
func (d *Deployment) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*Deployment) GetEnvironment ¶
func (d *Deployment) GetEnvironment() string
GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.
func (*Deployment) GetID ¶
func (d *Deployment) GetID() int
GetID returns the ID field if it's non-nil, zero value otherwise.
func (*Deployment) GetRef ¶
func (d *Deployment) GetRef() string
GetRef returns the Ref field if it's non-nil, zero value otherwise.
func (*Deployment) GetRepositoryURL ¶
func (d *Deployment) GetRepositoryURL() string
GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.
func (*Deployment) GetSHA ¶
func (d *Deployment) GetSHA() string
GetSHA returns the SHA field if it's non-nil, zero value otherwise.
func (*Deployment) GetStatusesURL ¶
func (d *Deployment) GetStatusesURL() string
GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.
func (*Deployment) GetTask ¶
func (d *Deployment) GetTask() string
GetTask returns the Task field if it's non-nil, zero value otherwise.
func (*Deployment) GetURL ¶
func (d *Deployment) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
func (*Deployment) GetUpdatedAt ¶
func (d *Deployment) GetUpdatedAt() Timestamp
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
type DeploymentEvent ¶
type DeploymentEvent struct { Deployment *Deployment `json:"deployment,omitempty"` Repo *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` }
DeploymentEvent represents a deployment. The Webhook event name is "deployment".
Events of this type are not visible in timelines, they are only used to trigger hooks.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#deploymentevent
type DeploymentRequest ¶
type DeploymentRequest struct { Ref *string `json:"ref,omitempty"` Task *string `json:"task,omitempty"` AutoMerge *bool `json:"auto_merge,omitempty"` RequiredContexts *[]string `json:"required_contexts,omitempty"` Payload *string `json:"payload,omitempty"` Environment *string `json:"environment,omitempty"` Description *string `json:"description,omitempty"` TransientEnvironment *bool `json:"transient_environment,omitempty"` ProductionEnvironment *bool `json:"production_environment,omitempty"` }
DeploymentRequest represents a deployment request
func (*DeploymentRequest) GetAutoMerge ¶
func (d *DeploymentRequest) GetAutoMerge() bool
GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetDescription ¶
func (d *DeploymentRequest) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetEnvironment ¶
func (d *DeploymentRequest) GetEnvironment() string
GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetPayload ¶
func (d *DeploymentRequest) GetPayload() string
GetPayload returns the Payload field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetProductionEnvironment ¶
func (d *DeploymentRequest) GetProductionEnvironment() bool
GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetRef ¶
func (d *DeploymentRequest) GetRef() string
GetRef returns the Ref field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetRequiredContexts ¶
func (d *DeploymentRequest) GetRequiredContexts() []string
GetRequiredContexts returns the RequiredContexts field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetTask ¶
func (d *DeploymentRequest) GetTask() string
GetTask returns the Task field if it's non-nil, zero value otherwise.
func (*DeploymentRequest) GetTransientEnvironment ¶
func (d *DeploymentRequest) GetTransientEnvironment() bool
GetTransientEnvironment returns the TransientEnvironment field if it's non-nil, zero value otherwise.
type DeploymentStatus ¶
type DeploymentStatus struct { ID *int `json:"id,omitempty"` // State is the deployment state. // Possible values are: "pending", "success", "failure", "error", "inactive". State *string `json:"state,omitempty"` Creator *User `json:"creator,omitempty"` Description *string `json:"description,omitempty"` TargetURL *string `json:"target_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` DeploymentURL *string `json:"deployment_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` }
DeploymentStatus represents the status of a particular deployment.
func (*DeploymentStatus) GetCreatedAt ¶
func (d *DeploymentStatus) GetCreatedAt() Timestamp
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetDeploymentURL ¶
func (d *DeploymentStatus) GetDeploymentURL() string
GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetDescription ¶
func (d *DeploymentStatus) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetID ¶
func (d *DeploymentStatus) GetID() int
GetID returns the ID field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetRepositoryURL ¶
func (d *DeploymentStatus) GetRepositoryURL() string
GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetState ¶
func (d *DeploymentStatus) GetState() string
GetState returns the State field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetTargetURL ¶
func (d *DeploymentStatus) GetTargetURL() string
GetTargetURL returns the TargetURL field if it's non-nil, zero value otherwise.
func (*DeploymentStatus) GetUpdatedAt ¶
func (d *DeploymentStatus) GetUpdatedAt() Timestamp
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
type DeploymentStatusEvent ¶
type DeploymentStatusEvent struct { Deployment *Deployment `json:"deployment,omitempty"` DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` Repo *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` }
DeploymentStatusEvent represents a deployment status. The Webhook event name is "deployment_status".
Events of this type are not visible in timelines, they are only used to trigger hooks.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#deploymentstatusevent
type DeploymentStatusRequest ¶
type DeploymentStatusRequest struct { State *string `json:"state,omitempty"` LogURL *string `json:"log_url,omitempty"` Description *string `json:"description,omitempty"` EnvironmentURL *string `json:"environment_url,omitempty"` AutoInactive *bool `json:"auto_inactive,omitempty"` }
DeploymentStatusRequest represents a deployment request
func (*DeploymentStatusRequest) GetAutoInactive ¶
func (d *DeploymentStatusRequest) GetAutoInactive() bool
GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise.
func (*DeploymentStatusRequest) GetDescription ¶
func (d *DeploymentStatusRequest) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*DeploymentStatusRequest) GetEnvironmentURL ¶
func (d *DeploymentStatusRequest) GetEnvironmentURL() string
GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.
func (*DeploymentStatusRequest) GetLogURL ¶
func (d *DeploymentStatusRequest) GetLogURL() string
GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.
func (*DeploymentStatusRequest) GetState ¶
func (d *DeploymentStatusRequest) GetState() string
GetState returns the State field if it's non-nil, zero value otherwise.
type DeploymentsListOptions ¶
type DeploymentsListOptions struct { // SHA of the Deployment. SHA string `url:"sha,omitempty"` // List deployments for a given ref. Ref string `url:"ref,omitempty"` // List deployments for a given task. Task string `url:"task,omitempty"` // List deployments for a given environment. Environment string `url:"environment,omitempty"` ListOptions }
DeploymentsListOptions specifies the optional parameters to the RepositoriesService.ListDeployments method.
type DismissalRestrictions ¶
type DismissalRestrictions struct { // The list of users who can dimiss pull request reviews. Users []*User `json:"users"` // The list of teams which can dismiss pull request reviews. Teams []*Team `json:"teams"` }
DismissalRestrictions specifies which users and teams can dismiss pull request reviews.
type DismissalRestrictionsRequest ¶
type DismissalRestrictionsRequest struct { // The list of user logins who can dismiss pull request reviews. (Required; use []string{} instead of nil for empty list.) Users []string `json:"users"` // The list of team slugs which can dismiss pull request reviews. (Required; use []string{} instead of nil for empty list.) Teams []string `json:"teams"` }
DismissalRestrictionsRequest represents the request to create/edit the restriction to allows only specific users or teams to dimiss pull request reviews. It is separate from DismissalRestrictions above because the request structure is different from the response structure.
type DraftReviewComment ¶
type DraftReviewComment struct { Path *string `json:"path,omitempty"` Position *int `json:"position,omitempty"` Body *string `json:"body,omitempty"` }
DraftReviewComment represents a comment part of the review.
func (*DraftReviewComment) GetBody ¶
func (d *DraftReviewComment) GetBody() string
GetBody returns the Body field if it's non-nil, zero value otherwise.
func (*DraftReviewComment) GetPath ¶
func (d *DraftReviewComment) GetPath() string
GetPath returns the Path field if it's non-nil, zero value otherwise.
func (*DraftReviewComment) GetPosition ¶
func (d *DraftReviewComment) GetPosition() int
GetPosition returns the Position field if it's non-nil, zero value otherwise.
func (DraftReviewComment) String ¶
func (c DraftReviewComment) String() string
type EditChange ¶
type EditChange struct { Title *struct { From *string `json:"from,omitempty"` } `json:"title,omitempty"` Body *struct { From *string `json:"from,omitempty"` } `json:"body,omitempty"` }
EditChange represents the changes when an issue, pull request, or comment has been edited.
type Error ¶
type Error struct { Resource string `json:"resource"` // resource on which the error occurred Field string `json:"field"` // field on which the error occurred Code string `json:"code"` // validation error code Message string `json:"message"` // Message describing the error. Errors with Code == "custom" will always have this set. }
An Error reports more details on an individual error in an ErrorResponse. These are the possible validation error codes:
missing: resource does not exist missing_field: a required field on a resource has not been set invalid: the formatting of a field is invalid already_exists: another resource has the same valid as this field custom: some resources return this (e.g. github.User.CreateKey()), additional information is set in the Message field of the Error
GitHub API docs: https://developer.github.com/v3/#client-errors