go-github: github.com/google/go-github/github Index | Examples | Files

package github

import "github.com/google/go-github/github"

Package github provides a client for using the GitHub API.

Usage:

import "github.com/google/go-github/github"

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.

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. To receive the higher rate limit when making calls that are not issued on behalf of a user, use the UnauthenticatedRateLimitedTransport.

The Rate method on a client returns the rate limit information based on the most recent API call. This is updated on every call, but may be out of date if it's been some time since the last API call and other clients have made subsequent requests since then. You can always call RateLimits() directly to get 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.ListOptions.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

Examples

Package Files

activity.go activity_events.go activity_notifications.go activity_star.go activity_watching.go admin.go authorizations.go doc.go event_types.go gists.go gists_comments.go git.go git_blobs.go git_commits.go git_refs.go git_tags.go git_trees.go github-accessors.go github.go gitignore.go integration.go integration_installation.go issues.go issues_assignees.go issues_comments.go issues_events.go issues_labels.go issues_milestones.go issues_timeline.go licenses.go messages.go migrations.go migrations_source_import.go misc.go orgs.go orgs_hooks.go orgs_members.go orgs_outside_collaborators.go orgs_projects.go orgs_teams.go projects.go pulls.go pulls_comments.go pulls_reviewers.go pulls_reviews.go reactions.go repos.go repos_collaborators.go repos_comments.go repos_commits.go repos_contents.go repos_deployments.go repos_forks.go repos_hooks.go repos_invitations.go repos_keys.go repos_merging.go repos_pages.go repos_projects.go repos_releases.go repos_stats.go repos_statuses.go repos_traffic.go search.go strings.go timestamp.go users.go users_administration.go users_emails.go users_followers.go users_gpg_keys.go users_keys.go without_appengine.go

Constants

const (
    // Tarball specifies an archive in gzipped tar format.
    Tarball archiveFormat = "tarball"

    // Zipball specifies an archive in zip format.
    Zipball archiveFormat = "zipball"
)

func Bool Uses

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse Uses

func CheckResponse(r *http.Response) error

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 Int Uses

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func ParseWebHook Uses

func ParseWebHook(messageType string, payload []byte) (interface{}, error)

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 Uses

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func Stringify Uses

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 Uses

func ValidatePayload(r *http.Request, secretKey []byte) (payload []byte, err error)

ValidatePayload validates an incoming GitHub Webhook event request and returns the (JSON) payload. 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 Uses

func WebHookType(r *http.Request) string

WebHookType returns the event type of webhook request r.

type APIMeta Uses

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 Uses

func (a *APIMeta) GetVerifiablePasswordAuthentication() bool

GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise.

type AbuseRateLimitError Uses

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 Uses

func (r *AbuseRateLimitError) Error() string

func (*AbuseRateLimitError) GetRetryAfter Uses

func (a *AbuseRateLimitError) GetRetryAfter() time.Duration

GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise.

type AcceptedError Uses

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 Uses

func (*AcceptedError) Error() string

type ActivityListStarredOptions Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error)

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error)

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 Uses

func (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *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 Uses

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 Uses

func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error)

Star a repository as the authenticated user.

GitHub API docs: https://developer.github.com/v3/activity/starring/#star-a-repository

func (*ActivityService) Unstar Uses

func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error)

Unstar a repository as the authenticated user.

GitHub API docs: https://developer.github.com/v3/activity/starring/#unstar-a-repository

type AdminService Uses

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 Uses

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 Uses

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 Authorization Uses

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"`
    UpdateAt       *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 Uses

func (a *Authorization) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Authorization) GetFingerprint Uses

func (a *Authorization) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*Authorization) GetHashedToken Uses

func (a *Authorization) GetHashedToken() string

GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.

func (*Authorization) GetID Uses

func (a *Authorization) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Authorization) GetNote Uses

func (a *Authorization) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*Authorization) GetNoteURL Uses

func (a *Authorization) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (*Authorization) GetToken Uses

func (a *Authorization) GetToken() string

GetToken returns the Token field if it's non-nil, zero value otherwise.

func (*Authorization) GetTokenLastEight Uses

func (a *Authorization) GetTokenLastEight() string

GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.

func (*Authorization) GetURL Uses

func (a *Authorization) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Authorization) GetUpdateAt Uses

func (a *Authorization) GetUpdateAt() Timestamp

GetUpdateAt returns the UpdateAt field if it's non-nil, zero value otherwise.

func (Authorization) String Uses

func (a Authorization) String() string

type AuthorizationApp Uses

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 Uses

func (a *AuthorizationApp) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetName Uses

func (a *AuthorizationApp) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*AuthorizationApp) GetURL Uses

func (a *AuthorizationApp) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (AuthorizationApp) String Uses

func (a AuthorizationApp) String() string

type AuthorizationRequest Uses

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 Uses

func (a *AuthorizationRequest) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetClientSecret Uses

func (a *AuthorizationRequest) GetClientSecret() string

GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetFingerprint Uses

func (a *AuthorizationRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNote Uses

func (a *AuthorizationRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationRequest) GetNoteURL Uses

func (a *AuthorizationRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (AuthorizationRequest) String Uses

func (a AuthorizationRequest) String() string

type AuthorizationUpdateRequest Uses

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 Uses

func (a *AuthorizationUpdateRequest) GetFingerprint() string

GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNote Uses

func (a *AuthorizationUpdateRequest) GetNote() string

GetNote returns the Note field if it's non-nil, zero value otherwise.

func (*AuthorizationUpdateRequest) GetNoteURL Uses

func (a *AuthorizationUpdateRequest) GetNoteURL() string

GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.

func (AuthorizationUpdateRequest) String Uses

func (a AuthorizationUpdateRequest) String() string

type AuthorizationsService Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *AuthorizationsService) Delete(ctx context.Context, id int) (*Response, error)

Delete a single authorization.

GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization

func (*AuthorizationsService) DeleteGrant Uses

func (s *AuthorizationsService) DeleteGrant(ctx context.Context, id int) (*Response, error)

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 Uses

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 Uses

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 Uses

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 Uses

func (s *AuthorizationsService) GetGrant(ctx context.Context, id int) (*Grant, *Response, error)

GetGrant gets a single OAuth application grant.

GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant

func (*AuthorizationsService) GetOrCreateForApp Uses

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 Uses

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 Uses

func (s *AuthorizationsService) ListGrants(ctx context.Context) ([]*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 Uses

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 Uses

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 Uses

type BasicAuthTransport struct {
    Username string // GitHub username
    Password string // GitHub password
    OTP      string // one-time password for users with two-factor auth enabled

    // 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 Uses

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.

func (*BasicAuthTransport) RoundTrip Uses

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type Blob Uses

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 Uses

func (b *Blob) GetContent() string

GetContent returns the Content field if it's non-nil, zero value otherwise.

func (*Blob) GetEncoding Uses

func (b *Blob) GetEncoding() string

GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.

func (*Blob) GetSHA Uses

func (b *Blob) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Blob) GetSize Uses

func (b *Blob) GetSize() int

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*Blob) GetURL Uses

func (b *Blob) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type Branch Uses

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) GetName Uses

func (b *Branch) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Branch) GetProtected Uses

func (b *Branch) GetProtected() bool

GetProtected returns the Protected field if it's non-nil, zero value otherwise.

type BranchRestrictions Uses

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 Uses

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 Uses

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
    Admin          *AdminService
    Authorizations *AuthorizationsService
    Gists          *GistsService
    Git            *GitService
    Gitignores     *GitignoresService
    Integrations   *IntegrationsService
    Issues         *IssuesService
    Organizations  *OrganizationsService
    Projects       *ProjectsService
    PullRequests   *PullRequestsService
    Repositories   *RepositoriesService
    Search         *SearchService
    Users          *UsersService
    Licenses       *LicensesService
    Migrations     *MigrationService
    Reactions      *ReactionsService
    // contains filtered or unexported fields
}

A Client manages communication with the GitHub API.

func NewClient Uses

func NewClient(httpClient *http.Client) *Client

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 (*Client) APIMeta Uses

func (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error)

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 Uses

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

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) ListEmojis Uses

func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error)

ListEmojis returns the emojis available to use on GitHub.

GitHub API docs: https://developer.github.com/v3/emojis/

func (*Client) ListServiceHooks Uses

func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error)

ListServiceHooks lists all of the available service hooks.

GitHub API docs: https://developer.github.com/webhooks/#services

func (*Client) Markdown Uses

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/

Code:

client := github.NewClient(nil)

input := "# heading #\n\nLink to issue #1"
opt := &github.MarkdownOptions{Mode: "gfm", Context: "google/go-github"}

output, _, err := client.Markdown(context.Background(), input, opt)
if err != nil {
    fmt.Println(err)
}

fmt.Println(output)

func (*Client) NewRequest Uses

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

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 Uses

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 Uses

func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error)

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 Uses

func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error)

RateLimits returns the rate limits for the current client.

func (*Client) Zen Uses

func (c *Client) Zen(ctx context.Context) (string, *Response, error)

Zen returns a random line from The Zen of GitHub.

see also: http://warpspire.com/posts/taste/

type CodeResult Uses

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 Uses

func (c *CodeResult) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*CodeResult) GetName Uses

func (c *CodeResult) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CodeResult) GetPath Uses

func (c *CodeResult) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*CodeResult) GetSHA Uses

func (c *CodeResult) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (CodeResult) String Uses

func (c CodeResult) String() string

type CodeSearchResult Uses

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 Uses

func (c *CodeSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*CodeSearchResult) GetTotal Uses

func (c *CodeSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type CombinedStatus Uses

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 Uses

func (c *CombinedStatus) GetCommitURL() string

GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetName Uses

func (c *CombinedStatus) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetRepositoryURL Uses

func (c *CombinedStatus) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetSHA Uses

func (c *CombinedStatus) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetState Uses

func (c *CombinedStatus) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*CombinedStatus) GetTotalCount Uses

func (c *CombinedStatus) GetTotalCount() int

GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.

func (CombinedStatus) String Uses

func (s CombinedStatus) String() string

type Commit Uses

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"`
    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 Uses

func (c *Commit) GetCommentCount() int

GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.

func (*Commit) GetMessage Uses

func (c *Commit) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Commit) GetSHA Uses

func (c *Commit) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Commit) GetURL Uses

func (c *Commit) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (Commit) String Uses

func (c Commit) String() string

type CommitAuthor Uses

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 Uses

func (c *CommitAuthor) GetDate() time.Time

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetEmail Uses

func (c *CommitAuthor) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetLogin Uses

func (c *CommitAuthor) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*CommitAuthor) GetName Uses

func (c *CommitAuthor) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (CommitAuthor) String Uses

func (c CommitAuthor) String() string

type CommitCommentEvent Uses

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 Uses

func (c *CommitCommentEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type CommitFile Uses

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 Uses

func (c *CommitFile) GetAdditions() int

GetAdditions returns the Additions field if it's non-nil, zero value otherwise.

func (*CommitFile) GetBlobURL Uses

func (c *CommitFile) GetBlobURL() string

GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetChanges Uses

func (c *CommitFile) GetChanges() int

GetChanges returns the Changes field if it's non-nil, zero value otherwise.

func (*CommitFile) GetContentsURL Uses

func (c *CommitFile) GetContentsURL() string

GetContentsURL returns the ContentsURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetDeletions Uses

func (c *CommitFile) GetDeletions() int

GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.

func (*CommitFile) GetFilename Uses

func (c *CommitFile) GetFilename() string

GetFilename returns the Filename field if it's non-nil, zero value otherwise.

func (*CommitFile) GetPatch Uses

func (c *CommitFile) GetPatch() string

GetPatch returns the Patch field if it's non-nil, zero value otherwise.

func (*CommitFile) GetRawURL Uses

func (c *CommitFile) GetRawURL() string

GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.

func (*CommitFile) GetSHA Uses

func (c *CommitFile) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*CommitFile) GetStatus Uses

func (c *CommitFile) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (CommitFile) String Uses

func (c CommitFile) String() string

type CommitResult Uses

type CommitResult struct {
    Hash           *string     `json:"hash,omitempty"`
    Message        *string     `json:"message,omitempty"`
    AuthorID       *int        `json:"author_id,omitempty"`
    AuthorName     *string     `json:"author_name,omitempty"`
    AuthorEmail    *string     `json:"author_email,omitempty"`
    AuthorDate     *Timestamp  `json:"author_date,omitempty"`
    CommitterID    *int        `json:"committer_id,omitempty"`
    CommitterName  *string     `json:"committer_name,omitempty"`
    CommitterEmail *string     `json:"committer_email,omitempty"`
    CommitterDate  *Timestamp  `json:"committer_date,omitempty"`
    Repository     *Repository `json:"repository,omitempty"`
}

CommitResult represents a commit object as returned in commit search endpoint response.

func (*CommitResult) GetAuthorDate Uses

func (c *CommitResult) GetAuthorDate() Timestamp

GetAuthorDate returns the AuthorDate field if it's non-nil, zero value otherwise.

func (*CommitResult) GetAuthorEmail Uses

func (c *CommitResult) GetAuthorEmail() string

GetAuthorEmail returns the AuthorEmail field if it's non-nil, zero value otherwise.

func (*CommitResult) GetAuthorID Uses

func (c *CommitResult) GetAuthorID() int

GetAuthorID returns the AuthorID field if it's non-nil, zero value otherwise.

func (*CommitResult) GetAuthorName Uses

func (c *CommitResult) GetAuthorName() string

GetAuthorName returns the AuthorName field if it's non-nil, zero value otherwise.

func (*CommitResult) GetCommitterDate Uses

func (c *CommitResult) GetCommitterDate() Timestamp

GetCommitterDate returns the CommitterDate field if it's non-nil, zero value otherwise.

func (*CommitResult) GetCommitterEmail Uses

func (c *CommitResult) GetCommitterEmail() string

GetCommitterEmail returns the CommitterEmail field if it's non-nil, zero value otherwise.

func (*CommitResult) GetCommitterID Uses

func (c *CommitResult) GetCommitterID() int

GetCommitterID returns the CommitterID field if it's non-nil, zero value otherwise.

func (*CommitResult) GetCommitterName Uses

func (c *CommitResult) GetCommitterName() string

GetCommitterName returns the CommitterName field if it's non-nil, zero value otherwise.

func (*CommitResult) GetHash Uses

func (c *CommitResult) GetHash() string

GetHash returns the Hash field if it's non-nil, zero value otherwise.

func (*CommitResult) GetMessage Uses

func (c *CommitResult) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

type CommitStats Uses

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 Uses

func (c *CommitStats) GetAdditions() int

GetAdditions returns the Additions field if it's non-nil, zero value otherwise.

func (*CommitStats) GetDeletions Uses

func (c *CommitStats) GetDeletions() int

GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.

func (*CommitStats) GetTotal Uses

func (c *CommitStats) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

func (CommitStats) String Uses

func (c CommitStats) String() string

type CommitsComparison Uses

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"`
}

CommitsComparison is the result of comparing two commits. See CompareCommits() for details.

func (*CommitsComparison) GetAheadBy Uses

func (c *CommitsComparison) GetAheadBy() int

GetAheadBy returns the AheadBy field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetBehindBy Uses

func (c *CommitsComparison) GetBehindBy() int

GetBehindBy returns the BehindBy field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetStatus Uses

func (c *CommitsComparison) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*CommitsComparison) GetTotalCommits Uses

func (c *CommitsComparison) GetTotalCommits() int

GetTotalCommits returns the TotalCommits field if it's non-nil, zero value otherwise.

func (CommitsComparison) String Uses

func (c CommitsComparison) String() string

type CommitsListOptions Uses

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 Uses

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 Uses

func (c *CommitsSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*CommitsSearchResult) GetTotal Uses

func (c *CommitsSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type Contributor Uses

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 Uses

func (c *Contributor) GetAvatarURL() string

GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetContributions Uses

func (c *Contributor) GetContributions() int

GetContributions returns the Contributions field if it's non-nil, zero value otherwise.

func (*Contributor) GetEventsURL Uses

func (c *Contributor) GetEventsURL() string

GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetFollowersURL Uses

func (c *Contributor) GetFollowersURL() string

GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetFollowingURL Uses

func (c *Contributor) GetFollowingURL() string

GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetGistsURL Uses

func (c *Contributor) GetGistsURL() string

GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetGravatarID Uses

func (c *Contributor) GetGravatarID() string

GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.

func (*Contributor) GetHTMLURL Uses

func (c *Contributor) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetID Uses

func (c *Contributor) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Contributor) GetLogin Uses

func (c *Contributor) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*Contributor) GetOrganizationsURL Uses

func (c *Contributor) GetOrganizationsURL() string

GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetReceivedEventsURL Uses

func (c *Contributor) GetReceivedEventsURL() string

GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetReposURL Uses

func (c *Contributor) GetReposURL() string

GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetSiteAdmin Uses

func (c *Contributor) GetSiteAdmin() bool

GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.

func (*Contributor) GetStarredURL Uses

func (c *Contributor) GetStarredURL() string

GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetSubscriptionsURL Uses

func (c *Contributor) GetSubscriptionsURL() string

GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.

func (*Contributor) GetType Uses

func (c *Contributor) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Contributor) GetURL Uses

func (c *Contributor) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type ContributorStats Uses

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 Uses

func (c *ContributorStats) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

func (ContributorStats) String Uses

func (c ContributorStats) String() string

type CreateEvent Uses

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 Uses

func (c *CreateEvent) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetMasterBranch Uses

func (c *CreateEvent) GetMasterBranch() string

GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetPusherType Uses

func (c *CreateEvent) GetPusherType() string

GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetRef Uses

func (c *CreateEvent) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*CreateEvent) GetRefType Uses

func (c *CreateEvent) GetRefType() string

GetRefType returns the RefType field if it's non-nil, zero value otherwise.

type DeleteEvent Uses

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 Uses

func (d *DeleteEvent) GetPusherType() string

GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.

func (*DeleteEvent) GetRef Uses

func (d *DeleteEvent) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*DeleteEvent) GetRefType Uses

func (d *DeleteEvent) GetRefType() string

GetRefType returns the RefType field if it's non-nil, zero value otherwise.

type Deployment Uses

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:"pushed_at,omitempty"`
    StatusesURL   *string         `json:"statuses_url,omitempty"`
    RepositoryURL *string         `json:"repository_url,omitempty"`
}

Deployment represents a deployment in a repo

func (*Deployment) GetCreatedAt Uses

func (d *Deployment) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Deployment) GetDescription Uses

func (d *Deployment) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Deployment) GetEnvironment Uses

func (d *Deployment) GetEnvironment() string

GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.

func (*Deployment) GetID Uses

func (d *Deployment) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Deployment) GetRef Uses

func (d *Deployment) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*Deployment) GetRepositoryURL Uses

func (d *Deployment) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*Deployment) GetSHA Uses

func (d *Deployment) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Deployment) GetStatusesURL Uses

func (d *Deployment) GetStatusesURL() string

GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.

func (*Deployment) GetTask Uses

func (d *Deployment) GetTask() string

GetTask returns the Task field if it's non-nil, zero value otherwise.

func (*Deployment) GetURL Uses

func (d *Deployment) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Deployment) GetUpdatedAt Uses

func (d *Deployment) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type DeploymentEvent Uses

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 Uses

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 Uses

func (d *DeploymentRequest) GetAutoMerge() bool

GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetDescription Uses

func (d *DeploymentRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetEnvironment Uses

func (d *DeploymentRequest) GetEnvironment() string

GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetPayload Uses

func (d *DeploymentRequest) GetPayload() string

GetPayload returns the Payload field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetProductionEnvironment Uses

func (d *DeploymentRequest) GetProductionEnvironment() bool

GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetRef Uses

func (d *DeploymentRequest) GetRef() string

GetRef returns the Ref field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetRequiredContexts Uses

func (d *DeploymentRequest) GetRequiredContexts() []string

GetRequiredContexts returns the RequiredContexts field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetTask Uses

func (d *DeploymentRequest) GetTask() string

GetTask returns the Task field if it's non-nil, zero value otherwise.

func (*DeploymentRequest) GetTransientEnvironment Uses

func (d *DeploymentRequest) GetTransientEnvironment() bool

GetTransientEnvironment returns the TransientEnvironment field if it's non-nil, zero value otherwise.

type DeploymentStatus Uses

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:"pushed_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 Uses

func (d *DeploymentStatus) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetDeploymentURL Uses

func (d *DeploymentStatus) GetDeploymentURL() string

GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetDescription Uses

func (d *DeploymentStatus) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetID Uses

func (d *DeploymentStatus) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetRepositoryURL Uses

func (d *DeploymentStatus) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetState Uses

func (d *DeploymentStatus) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetTargetURL Uses

func (d *DeploymentStatus) GetTargetURL() string

GetTargetURL returns the TargetURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatus) GetUpdatedAt Uses

func (d *DeploymentStatus) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type DeploymentStatusEvent Uses

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 Uses

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 Uses

func (d *DeploymentStatusRequest) GetAutoInactive() bool

GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise.

func (*DeploymentStatusRequest) GetDescription Uses

func (d *DeploymentStatusRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*DeploymentStatusRequest) GetEnvironmentURL Uses

func (d *DeploymentStatusRequest) GetEnvironmentURL() string

GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatusRequest) GetLogURL Uses

func (d *DeploymentStatusRequest) GetLogURL() string

GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.

func (*DeploymentStatusRequest) GetState Uses

func (d *DeploymentStatusRequest) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

type DeploymentsListOptions Uses

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 DraftReviewComment Uses

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 Uses

func (d *DraftReviewComment) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*DraftReviewComment) GetPath Uses

func (d *DraftReviewComment) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*DraftReviewComment) GetPosition Uses

func (d *DraftReviewComment) GetPosition() int

GetPosition returns the Position field if it's non-nil, zero value otherwise.

func (DraftReviewComment) String Uses

func (c DraftReviewComment) String() string

type EditChange Uses

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 Uses

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

func (*Error) Error Uses

func (e *Error) Error() string

type ErrorResponse Uses

type ErrorResponse struct {
    Response *http.Response // HTTP response that caused this error
    Message  string         `json:"message"` // error message
    Errors   []Error        `json:"errors"`  // more detail on individual errors
    // Block is only populated on certain types of errors such as code 451.
    // See https://developer.github.com/changes/2016-03-17-the-451-status-code-is-now-supported/
    // for more information.
    Block *struct {
        Reason    string     `json:"reason,omitempty"`
        CreatedAt *Timestamp `json:"created_at,omitempty"`
    }   `json:"block,omitempty"`
    // Most errors will also include a documentation_url field pointing
    // to some content that might help you resolve the error, see
    // https://developer.github.com/v3/#client-errors
    DocumentationURL string `json:"documentation_url,omitempty"`
}

An ErrorResponse reports one or more errors caused by an API request.

GitHub API docs: https://developer.github.com/v3/#client-errors

func (*ErrorResponse) Error Uses

func (r *ErrorResponse) Error() string

type Event Uses

type Event struct {
    Type       *string          `json:"type,omitempty"`
    Public     *bool            `json:"public"`
    RawPayload *json.RawMessage `json:"payload,omitempty"`
    Repo       *Repository      `json:"repo,omitempty"`
    Actor      *User            `json:"actor,omitempty"`
    Org        *Organization    `json:"org,omitempty"`
    CreatedAt  *time.Time       `json:"created_at,omitempty"`
    ID         *string          `json:"id,omitempty"`
}

Event represents a GitHub event.

func (*Event) GetCreatedAt Uses

func (e *Event) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Event) GetID Uses

func (e *Event) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Event) GetPublic Uses

func (e *Event) GetPublic() bool

GetPublic returns the Public field if it's non-nil, zero value otherwise.

func (*Event) GetRawPayload Uses

func (e *Event) GetRawPayload() json.RawMessage

GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.

func (*Event) GetType Uses

func (e *Event) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Event) ParsePayload Uses

func (e *Event) ParsePayload() (payload interface{}, err error)

ParsePayload parses the event payload. For recognized event types, a value of the corresponding struct type will be returned.

func (*Event) Payload Uses

func (e *Event) Payload() (payload interface{})

Payload returns the parsed event payload. For recognized event types, a value of the corresponding struct type will be returned.

Deprecated: Use ParsePayload instead, which returns an error rather than panics if JSON unmarshaling raw payload fails.

func (Event) String Uses

func (e Event) String() string
type FeedLink struct {
    HRef *string `json:"href,omitempty"`
    Type *string `json:"type,omitempty"`
}

FeedLink represents a link to a related resource.

func (*FeedLink) GetHRef Uses

func (f *FeedLink) GetHRef() string

GetHRef returns the HRef field if it's non-nil, zero value otherwise.

func (*FeedLink) GetType Uses

func (f *FeedLink) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type Feeds Uses

type Feeds struct {
    TimelineURL                 *string  `json:"timeline_url,omitempty"`
    UserURL                     *string  `json:"user_url,omitempty"`
    CurrentUserPublicURL        *string  `json:"current_user_public_url,omitempty"`
    CurrentUserURL              *string  `json:"current_user_url,omitempty"`
    CurrentUserActorURL         *string  `json:"current_user_actor_url,omitempty"`
    CurrentUserOrganizationURL  *string  `json:"current_user_organization_url,omitempty"`
    CurrentUserOrganizationURLs []string `json:"current_user_organization_urls,omitempty"`
    Links                       *struct {
        Timeline                 *FeedLink  `json:"timeline,omitempty"`
        User                     *FeedLink  `json:"user,omitempty"`
        CurrentUserPublic        *FeedLink  `json:"current_user_public,omitempty"`
        CurrentUser              *FeedLink  `json:"current_user,omitempty"`
        CurrentUserActor         *FeedLink  `json:"current_user_actor,omitempty"`
        CurrentUserOrganization  *FeedLink  `json:"current_user_organization,omitempty"`
        CurrentUserOrganizations []FeedLink `json:"current_user_organizations,omitempty"`
    }   `json:"_links,omitempty"`
}

Feeds represents timeline resources in Atom format.

func (*Feeds) GetCurrentUserActorURL Uses

func (f *Feeds) GetCurrentUserActorURL() string

GetCurrentUserActorURL returns the CurrentUserActorURL field if it's non-nil, zero value otherwise.

func (*Feeds) GetCurrentUserOrganizationURL Uses

func (f *Feeds) GetCurrentUserOrganizationURL() string

GetCurrentUserOrganizationURL returns the CurrentUserOrganizationURL field if it's non-nil, zero value otherwise.

func (*Feeds) GetCurrentUserPublicURL Uses

func (f *Feeds) GetCurrentUserPublicURL() string

GetCurrentUserPublicURL returns the CurrentUserPublicURL field if it's non-nil, zero value otherwise.

func (*Feeds) GetCurrentUserURL Uses

func (f *Feeds) GetCurrentUserURL() string

GetCurrentUserURL returns the CurrentUserURL field if it's non-nil, zero value otherwise.

func (*Feeds) GetTimelineURL Uses

func (f *Feeds) GetTimelineURL() string

GetTimelineURL returns the TimelineURL field if it's non-nil, zero value otherwise.

func (*Feeds) GetUserURL Uses

func (f *Feeds) GetUserURL() string

GetUserURL returns the UserURL field if it's non-nil, zero value otherwise.

type ForkEvent Uses

type ForkEvent struct {
    // Forkee is the created repository.
    Forkee *Repository `json:"forkee,omitempty"`

    // The following fields are only populated by Webhook events.
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

ForkEvent is triggered when a user forks a repository. The Webhook event name is "fork".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#forkevent

type GPGEmail Uses

type GPGEmail struct {
    Email    *string `json:"email,omitempty"`
    Verified *bool   `json:"verified,omitempty"`
}

GPGEmail represents an email address associated to a GPG key.

func (*GPGEmail) GetEmail Uses

func (g *GPGEmail) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*GPGEmail) GetVerified Uses

func (g *GPGEmail) GetVerified() bool

GetVerified returns the Verified field if it's non-nil, zero value otherwise.

type GPGKey Uses

type GPGKey struct {
    ID                *int       `json:"id,omitempty"`
    PrimaryKeyID      *int       `json:"primary_key_id,omitempty"`
    KeyID             *string    `json:"key_id,omitempty"`
    PublicKey         *string    `json:"public_key,omitempty"`
    Emails            []GPGEmail `json:"emails,omitempty"`
    Subkeys           []GPGKey   `json:"subkeys,omitempty"`
    CanSign           *bool      `json:"can_sign,omitempty"`
    CanEncryptComms   *bool      `json:"can_encrypt_comms,omitempty"`
    CanEncryptStorage *bool      `json:"can_encrypt_storage,omitempty"`
    CanCertify        *bool      `json:"can_certify,omitempty"`
    CreatedAt         *time.Time `json:"created_at,omitempty"`
    ExpiresAt         *time.Time `json:"expires_at,omitempty"`
}

GPGKey represents a GitHub user's public GPG key used to verify GPG signed commits and tags.

https://developer.github.com/changes/2016-04-04-git-signing-api-preview/

func (*GPGKey) GetCanCertify Uses

func (g *GPGKey) GetCanCertify() bool

GetCanCertify returns the CanCertify field if it's non-nil, zero value otherwise.

func (*GPGKey) GetCanEncryptComms Uses

func (g *GPGKey) GetCanEncryptComms() bool

GetCanEncryptComms returns the CanEncryptComms field if it's non-nil, zero value otherwise.

func (*GPGKey) GetCanEncryptStorage Uses

func (g *GPGKey) GetCanEncryptStorage() bool

GetCanEncryptStorage returns the CanEncryptStorage field if it's non-nil, zero value otherwise.

func (*GPGKey) GetCanSign Uses

func (g *GPGKey) GetCanSign() bool

GetCanSign returns the CanSign field if it's non-nil, zero value otherwise.

func (*GPGKey) GetCreatedAt Uses

func (g *GPGKey) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*GPGKey) GetExpiresAt Uses

func (g *GPGKey) GetExpiresAt() time.Time

GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.

func (*GPGKey) GetID Uses

func (g *GPGKey) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*GPGKey) GetKeyID Uses

func (g *GPGKey) GetKeyID() string

GetKeyID returns the KeyID field if it's non-nil, zero value otherwise.

func (*GPGKey) GetPrimaryKeyID Uses

func (g *GPGKey) GetPrimaryKeyID() int

GetPrimaryKeyID returns the PrimaryKeyID field if it's non-nil, zero value otherwise.

func (*GPGKey) GetPublicKey Uses

func (g *GPGKey) GetPublicKey() string

GetPublicKey returns the PublicKey field if it's non-nil, zero value otherwise.

func (GPGKey) String Uses

func (k GPGKey) String() string

String stringifies a GPGKey.

type Gist Uses

type Gist struct {
    ID          *string                   `json:"id,omitempty"`
    Description *string                   `json:"description,omitempty"`
    Public      *bool                     `json:"public,omitempty"`
    Owner       *User                     `json:"owner,omitempty"`
    Files       map[GistFilename]GistFile `json:"files,omitempty"`
    Comments    *int                      `json:"comments,omitempty"`
    HTMLURL     *string                   `json:"html_url,omitempty"`
    GitPullURL  *string                   `json:"git_pull_url,omitempty"`
    GitPushURL  *string                   `json:"git_push_url,omitempty"`
    CreatedAt   *time.Time                `json:"created_at,omitempty"`
    UpdatedAt   *time.Time                `json:"updated_at,omitempty"`
}

Gist represents a GitHub's gist.

func (*Gist) GetComments Uses

func (g *Gist) GetComments() int

GetComments returns the Comments field if it's non-nil, zero value otherwise.

func (*Gist) GetCreatedAt Uses

func (g *Gist) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Gist) GetDescription Uses

func (g *Gist) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Gist) GetGitPullURL Uses

func (g *Gist) GetGitPullURL() string

GetGitPullURL returns the GitPullURL field if it's non-nil, zero value otherwise.

func (*Gist) GetGitPushURL Uses

func (g *Gist) GetGitPushURL() string

GetGitPushURL returns the GitPushURL field if it's non-nil, zero value otherwise.

func (*Gist) GetHTMLURL Uses

func (g *Gist) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Gist) GetID Uses

func (g *Gist) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Gist) GetPublic Uses

func (g *Gist) GetPublic() bool

GetPublic returns the Public field if it's non-nil, zero value otherwise.

func (*Gist) GetUpdatedAt Uses

func (g *Gist) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Gist) String Uses

func (g Gist) String() string

type GistComment Uses

type GistComment struct {
    ID        *int       `json:"id,omitempty"`
    URL       *string    `json:"url,omitempty"`
    Body      *string    `json:"body,omitempty"`
    User      *User      `json:"user,omitempty"`
    CreatedAt *time.Time `json:"created_at,omitempty"`
}

GistComment represents a Gist comment.

func (*GistComment) GetBody Uses

func (g *GistComment) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*GistComment) GetCreatedAt Uses

func (g *GistComment) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*GistComment) GetID Uses

func (g *GistComment) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*GistComment) GetURL Uses

func (g *GistComment) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (GistComment) String Uses

func (g GistComment) String() string

type GistCommit Uses

type GistCommit struct {
    URL          *string      `json:"url,omitempty"`
    Version      *string      `json:"version,omitempty"`
    User         *User        `json:"user,omitempty"`
    ChangeStatus *CommitStats `json:"change_status,omitempty"`
    CommittedAt  *Timestamp   `json:"committed_at,omitempty"`
}

GistCommit represents a commit on a gist.

func (*GistCommit) GetCommittedAt Uses

func (g *GistCommit) GetCommittedAt() Timestamp

GetCommittedAt returns the CommittedAt field if it's non-nil, zero value otherwise.

func (*GistCommit) GetURL Uses

func (g *GistCommit) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*GistCommit) GetVersion Uses

func (g *GistCommit) GetVersion() string

GetVersion returns the Version field if it's non-nil, zero value otherwise.

func (GistCommit) String Uses

func (gc GistCommit) String() string

type GistFile Uses

type GistFile struct {
    Size     *int    `json:"size,omitempty"`
    Filename *string `json:"filename,omitempty"`
    Language *string `json:"language,omitempty"`
    Type     *string `json:"type,omitempty"`
    RawURL   *string `json:"raw_url,omitempty"`
    Content  *string `json:"content,omitempty"`
}

GistFile represents a file on a gist.

func (*GistFile) GetContent Uses

func (g *GistFile) GetContent() string

GetContent returns the Content field if it's non-nil, zero value otherwise.

func (*GistFile) GetFilename Uses

func (g *GistFile) GetFilename() string

GetFilename returns the Filename field if it's non-nil, zero value otherwise.

func (*GistFile) GetLanguage Uses

func (g *GistFile) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (*GistFile) GetRawURL Uses

func (g *GistFile) GetRawURL() string

GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.

func (*GistFile) GetSize Uses

func (g *GistFile) GetSize() int

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (*GistFile) GetType Uses

func (g *GistFile) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (GistFile) String Uses

func (g GistFile) String() string

type GistFilename Uses

type GistFilename string

GistFilename represents filename on a gist.

type GistFork Uses

type GistFork struct {
    URL       *string    `json:"url,omitempty"`
    User      *User      `json:"user,omitempty"`
    ID        *string    `json:"id,omitempty"`
    CreatedAt *Timestamp `json:"created_at,omitempty"`
    UpdatedAt *Timestamp `json:"updated_at,omitempty"`
}

GistFork represents a fork of a gist.

func (*GistFork) GetCreatedAt Uses

func (g *GistFork) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*GistFork) GetID Uses

func (g *GistFork) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*GistFork) GetURL Uses

func (g *GistFork) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*GistFork) GetUpdatedAt Uses

func (g *GistFork) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (GistFork) String Uses

func (gf GistFork) String() string

type GistListOptions Uses

type GistListOptions struct {
    // Since filters Gists by time.
    Since time.Time `url:"since,omitempty"`

    ListOptions
}

GistListOptions specifies the optional parameters to the GistsService.List, GistsService.ListAll, and GistsService.ListStarred methods.

type GistsService Uses

type GistsService service

GistsService handles communication with the Gist related methods of the GitHub API.

GitHub API docs: https://developer.github.com/v3/gists/

func (*GistsService) Create Uses

func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error)

Create a gist for authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#create-a-gist

func (*GistsService) CreateComment Uses

func (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error)

CreateComment creates a comment for a gist.

GitHub API docs: https://developer.github.com/v3/gists/comments/#create-a-comment

func (*GistsService) Delete Uses

func (s *GistsService) Delete(ctx context.Context, id string) (*Response, error)

Delete a gist.

GitHub API docs: https://developer.github.com/v3/gists/#delete-a-gist

func (*GistsService) DeleteComment Uses

func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int) (*Response, error)

DeleteComment deletes a gist comment.

GitHub API docs: https://developer.github.com/v3/gists/comments/#delete-a-comment

func (*GistsService) Edit Uses

func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error)

Edit a gist.

GitHub API docs: https://developer.github.com/v3/gists/#edit-a-gist

func (*GistsService) EditComment Uses

func (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int, comment *GistComment) (*GistComment, *Response, error)

EditComment edits an existing gist comment.

GitHub API docs: https://developer.github.com/v3/gists/comments/#edit-a-comment

func (*GistsService) Fork Uses

func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error)

Fork a gist.

GitHub API docs: https://developer.github.com/v3/gists/#fork-a-gist

func (*GistsService) Get Uses

func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error)

Get a single gist.

GitHub API docs: https://developer.github.com/v3/gists/#get-a-single-gist

func (*GistsService) GetComment Uses

func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int) (*GistComment, *Response, error)

GetComment retrieves a single comment from a gist.

GitHub API docs: https://developer.github.com/v3/gists/comments/#get-a-single-comment

func (*GistsService) GetRevision Uses

func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error)

GetRevision gets a specific revision of a gist.

GitHub API docs: https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist

func (*GistsService) IsStarred Uses

func (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error)

IsStarred checks if a gist is starred by authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#check-if-a-gist-is-starred

func (*GistsService) List Uses

func (s *GistsService) List(ctx context.Context, user string, opt *GistListOptions) ([]*Gist, *Response, error)

List gists for a user. Passing the empty string will list all public gists if called anonymously. However, if the call is authenticated, it will returns all gists for the authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#list-gists

func (*GistsService) ListAll Uses

func (s *GistsService) ListAll(ctx context.Context, opt *GistListOptions) ([]*Gist, *Response, error)

ListAll lists all public gists.

GitHub API docs: https://developer.github.com/v3/gists/#list-gists

func (*GistsService) ListComments Uses

func (s *GistsService) ListComments(ctx context.Context, gistID string, opt *ListOptions) ([]*GistComment, *Response, error)

ListComments lists all comments for a gist.

GitHub API docs: https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist

func (*GistsService) ListCommits Uses

func (s *GistsService) ListCommits(ctx context.Context, id string) ([]*GistCommit, *Response, error)

ListCommits lists commits of a gist.

GitHub API docs: https://developer.github.com/v3/gists/#list-gist-commits

func (*GistsService) ListForks Uses

func (s *GistsService) ListForks(ctx context.Context, id string) ([]*GistFork, *Response, error)

ListForks lists forks of a gist.

GitHub API docs: https://developer.github.com/v3/gists/#list-gist-forks

func (*GistsService) ListStarred Uses

func (s *GistsService) ListStarred(ctx context.Context, opt *GistListOptions) ([]*Gist, *Response, error)

ListStarred lists starred gists of authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#list-gists

func (*GistsService) Star Uses

func (s *GistsService) Star(ctx context.Context, id string) (*Response, error)

Star a gist on behalf of authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#star-a-gist

func (*GistsService) Unstar Uses

func (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error)

Unstar a gist on a behalf of authenticated user.

GitHub API docs: https://developer.github.com/v3/gists/#unstar-a-gist

type GitObject Uses

type GitObject struct {
    Type *string `json:"type"`
    SHA  *string `json:"sha"`
    URL  *string `json:"url"`
}

GitObject represents a Git object.

func (*GitObject) GetSHA Uses

func (g *GitObject) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*GitObject) GetType Uses

func (g *GitObject) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*GitObject) GetURL Uses

func (g *GitObject) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (GitObject) String Uses

func (o GitObject) String() string

type GitService Uses

type GitService service

GitService handles communication with the git data related methods of the GitHub API.

GitHub API docs: https://developer.github.com/v3/git/

func (*GitService) CreateBlob Uses

func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error)

CreateBlob creates a blob object.

GitHub API docs: https://developer.github.com/v3/git/blobs/#create-a-blob

func (*GitService) CreateCommit Uses

func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit) (*Commit, *Response, error)

CreateCommit creates a new commit in a repository. commit must not be nil.

The commit.Committer is optional and will be filled with the commit.Author data if omitted. If the commit.Author is omitted, it will be filled in with the authenticated user’s information and the current date.

GitHub API docs: https://developer.github.com/v3/git/commits/#create-a-commit

func (*GitService) CreateRef Uses

func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error)

CreateRef creates a new ref in a repository.

GitHub API docs: https://developer.github.com/v3/git/refs/#create-a-reference

func (*GitService) CreateTag Uses

func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error)

CreateTag creates a tag object.

GitHub API docs: https://developer.github.com/v3/git/tags/#create-a-tag-object

func (*GitService) CreateTree Uses

func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []TreeEntry) (*Tree, *Response, error)

CreateTree creates a new tree in a repository. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out.

GitHub API docs: https://developer.github.com/v3/git/trees/#create-a-tree

func (*GitService) DeleteRef Uses

func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error)

DeleteRef deletes a ref from a repository.

GitHub API docs: https://developer.github.com/v3/git/refs/#delete-a-reference

func (*GitService) GetBlob Uses

func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error)

GetBlob fetchs a blob from a repo given a SHA.

GitHub API docs: https://developer.github.com/v3/git/blobs/#get-a-blob

func (*GitService) GetCommit Uses

func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error)

GetCommit fetchs the Commit object for a given SHA.

GitHub API docs: https://developer.github.com/v3/git/commits/#get-a-commit

func (*GitService) GetRef Uses

func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error)

GetRef fetches the Reference object for a given Git ref.

GitHub API docs: https://developer.github.com/v3/git/refs/#get-a-reference

func (*GitService) GetTag Uses

func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error)

GetTag fetchs a tag from a repo given a SHA.

GitHub API docs: https://developer.github.com/v3/git/tags/#get-a-tag

func (*GitService) GetTree Uses

func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error)

GetTree fetches the Tree object for a given sha hash from a repository.

GitHub API docs: https://developer.github.com/v3/git/trees/#get-a-tree

func (*GitService) ListRefs Uses

func (s *GitService) ListRefs(ctx context.Context, owner, repo string, opt *ReferenceListOptions) ([]*Reference, *Response, error)

ListRefs lists all refs in a repository.

GitHub API docs: https://developer.github.com/v3/git/refs/#get-all-references

func (*GitService) UpdateRef Uses

func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error)

UpdateRef updates an existing ref in a repository.

GitHub API docs: https://developer.github.com/v3/git/refs/#update-a-reference

type Gitignore Uses

type Gitignore struct {
    Name   *string `json:"name,omitempty"`
    Source *string `json:"source,omitempty"`
}

Gitignore represents a .gitignore file as returned by the GitHub API.

func (*Gitignore) GetName Uses

func (g *Gitignore) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Gitignore) GetSource Uses

func (g *Gitignore) GetSource() string

GetSource returns the Source field if it's non-nil, zero value otherwise.

func (Gitignore) String Uses

func (g Gitignore) String() string

type GitignoresService Uses

type GitignoresService service

GitignoresService provides access to the gitignore related functions in the GitHub API.

GitHub API docs: https://developer.github.com/v3/gitignore/

func (GitignoresService) Get Uses

func (s GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error)

Get a Gitignore by name.

GitHub API docs: https://developer.github.com/v3/gitignore/#get-a-single-template

func (GitignoresService) List Uses

func (s GitignoresService) List(ctx context.Context) ([]string, *Response, error)

List all available Gitignore templates.

GitHub API docs: https://developer.github.com/v3/gitignore/#listing-available-templates

type GollumEvent Uses

type GollumEvent struct {
    Pages []*Page `json:"pages,omitempty"`

    // The following fields are only populated by Webhook events.
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

GollumEvent is triggered when a Wiki page is created or updated. The Webhook event name is "gollum".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#gollumevent

type Grant Uses

type Grant struct {
    ID        *int              `json:"id,omitempty"`
    URL       *string           `json:"url,omitempty"`
    App       *AuthorizationApp `json:"app,omitempty"`
    CreatedAt *Timestamp        `json:"created_at,omitempty"`
    UpdatedAt *Timestamp        `json:"updated_at,omitempty"`
    Scopes    []string          `json:"scopes,omitempty"`
}

Grant represents an OAuth application that has been granted access to an account.

func (*Grant) GetCreatedAt Uses

func (g *Grant) GetCreatedAt() Timestamp

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Grant) GetID Uses

func (g *Grant) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Grant) GetURL Uses

func (g *Grant) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Grant) GetUpdatedAt Uses

func (g *Grant) GetUpdatedAt() Timestamp

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Grant) String Uses

func (g Grant) String() string

type Hook Uses

type Hook struct {
    CreatedAt *time.Time             `json:"created_at,omitempty"`
    UpdatedAt *time.Time             `json:"updated_at,omitempty"`
    Name      *string                `json:"name,omitempty"`
    URL       *string                `json:"url,omitempty"`
    Events    []string               `json:"events,omitempty"`
    Active    *bool                  `json:"active,omitempty"`
    Config    map[string]interface{} `json:"config,omitempty"`
    ID        *int                   `json:"id,omitempty"`
}

Hook represents a GitHub (web and service) hook for a repository.

func (*Hook) GetActive Uses

func (h *Hook) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*Hook) GetCreatedAt Uses

func (h *Hook) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Hook) GetID Uses

func (h *Hook) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Hook) GetName Uses

func (h *Hook) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Hook) GetURL Uses

func (h *Hook) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Hook) GetUpdatedAt Uses

func (h *Hook) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Hook) String Uses

func (h Hook) String() string

type Import Uses

type Import struct {
    // The URL of the originating repository.
    VCSURL *string `json:"vcs_url,omitempty"`
    // The originating VCS type. Can be one of 'subversion', 'git',
    // 'mercurial', or 'tfvc'. Without this parameter, the import job will
    // take additional time to detect the VCS type before beginning the
    // import. This detection step will be reflected in the response.
    VCS *string `json:"vcs,omitempty"`
    // VCSUsername and VCSPassword are only used for StartImport calls that
    // are importing a password-protected repository.
    VCSUsername *string `json:"vcs_username,omitempty"`
    VCSPassword *string `json:"vcs_password,omitempty"`
    // For a tfvc import, the name of the project that is being imported.
    TFVCProject *string `json:"tfvc_project,omitempty"`

    // Describes whether the import has been opted in or out of using Git
    // LFS. The value can be 'opt_in', 'opt_out', or 'undecided' if no
    // action has been taken.
    UseLFS *string `json:"use_lfs,omitempty"`
    // Describes whether files larger than 100MB were found during the
    // importing step.
    HasLargeFiles *bool `json:"has_large_files,omitempty"`
    // The total size in gigabytes of files larger than 100MB found in the
    // originating repository.
    LargeFilesSize *int `json:"large_files_size,omitempty"`
    // The total number of files larger than 100MB found in the originating
    // repository. To see a list of these files, call LargeFiles.
    LargeFilesCount *int `json:"large_files_count,omitempty"`

    // Identifies the current status of an import. An import that does not
    // have errors will progress through these steps:
    //
    //     detecting - the "detection" step of the import is in progress
    //         because the request did not include a VCS parameter. The
    //         import is identifying the type of source control present at
    //         the URL.
    //     importing - the "raw" step of the import is in progress. This is
    //         where commit data is fetched from the original repository.
    //         The import progress response will include CommitCount (the
    //         total number of raw commits that will be imported) and
    //         Percent (0 - 100, the current progress through the import).
    //     mapping - the "rewrite" step of the import is in progress. This
    //         is where SVN branches are converted to Git branches, and
    //         where author updates are applied. The import progress
    //         response does not include progress information.
    //     pushing - the "push" step of the import is in progress. This is
    //         where the importer updates the repository on GitHub. The
    //         import progress response will include PushPercent, which is
    //         the percent value reported by git push when it is "Writing
    //         objects".
    //     complete - the import is complete, and the repository is ready
    //         on GitHub.
    //
    // If there are problems, you will see one of these in the status field:
    //
    //     auth_failed - the import requires authentication in order to
    //         connect to the original repository. Make an UpdateImport
    //         request, and include VCSUsername and VCSPassword.
    //     error - the import encountered an error. The import progress
    //         response will include the FailedStep and an error message.
    //         Contact GitHub support for more information.
    //     detection_needs_auth - the importer requires authentication for
    //         the originating repository to continue detection. Make an
    //         UpdatImport request, and include VCSUsername and
    //         VCSPassword.
    //     detection_found_nothing - the importer didn't recognize any
    //         source control at the URL.
    //     detection_found_multiple - the importer found several projects
    //         or repositories at the provided URL. When this is the case,
    //         the Import Progress response will also include a
    //         ProjectChoices field with the possible project choices as
    //         values. Make an UpdateImport request, and include VCS and
    //         (if applicable) TFVCProject.
    Status        *string `json:"status,omitempty"`
    CommitCount   *int    `json:"commit_count,omitempty"`
    StatusText    *string `json:"status_text,omitempty"`
    AuthorsCount  *int    `json:"authors_count,omitempty"`
    Percent       *int    `json:"percent,omitempty"`
    PushPercent   *int    `json:"push_percent,omitempty"`
    URL           *string `json:"url,omitempty"`
    HTMLURL       *string `json:"html_url,omitempty"`
    AuthorsURL    *string `json:"authors_url,omitempty"`
    RepositoryURL *string `json:"repository_url,omitempty"`
    Message       *string `json:"message,omitempty"`
    FailedStep    *string `json:"failed_step,omitempty"`

    // Human readable display name, provided when the Import appears as
    // part of ProjectChoices.
    HumanName *string `json:"human_name,omitempty"`

    // When the importer finds several projects or repositories at the
    // provided URLs, this will identify the available choices. Call
    // UpdateImport with the selected Import value.
    ProjectChoices []Import `json:"project_choices,omitempty"`
}

Import represents a repository import request.

func (*Import) GetAuthorsCount Uses

func (i *Import) GetAuthorsCount() int

GetAuthorsCount returns the AuthorsCount field if it's non-nil, zero value otherwise.

func (*Import) GetAuthorsURL Uses

func (i *Import) GetAuthorsURL() string

GetAuthorsURL returns the AuthorsURL field if it's non-nil, zero value otherwise.

func (*Import) GetCommitCount Uses

func (i *Import) GetCommitCount() int

GetCommitCount returns the CommitCount field if it's non-nil, zero value otherwise.

func (*Import) GetFailedStep Uses

func (i *Import) GetFailedStep() string

GetFailedStep returns the FailedStep field if it's non-nil, zero value otherwise.

func (*Import) GetHTMLURL Uses

func (i *Import) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Import) GetHasLargeFiles Uses

func (i *Import) GetHasLargeFiles() bool

GetHasLargeFiles returns the HasLargeFiles field if it's non-nil, zero value otherwise.

func (*Import) GetHumanName Uses

func (i *Import) GetHumanName() string

GetHumanName returns the HumanName field if it's non-nil, zero value otherwise.

func (*Import) GetLargeFilesCount Uses

func (i *Import) GetLargeFilesCount() int

GetLargeFilesCount returns the LargeFilesCount field if it's non-nil, zero value otherwise.

func (*Import) GetLargeFilesSize Uses

func (i *Import) GetLargeFilesSize() int

GetLargeFilesSize returns the LargeFilesSize field if it's non-nil, zero value otherwise.

func (*Import) GetMessage Uses

func (i *Import) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Import) GetPercent Uses

func (i *Import) GetPercent() int

GetPercent returns the Percent field if it's non-nil, zero value otherwise.

func (*Import) GetPushPercent Uses

func (i *Import) GetPushPercent() int

GetPushPercent returns the PushPercent field if it's non-nil, zero value otherwise.

func (*Import) GetRepositoryURL Uses

func (i *Import) GetRepositoryURL() string

GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.

func (*Import) GetStatus Uses

func (i *Import) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Import) GetStatusText Uses

func (i *Import) GetStatusText() string

GetStatusText returns the StatusText field if it's non-nil, zero value otherwise.

func (*Import) GetTFVCProject Uses

func (i *Import) GetTFVCProject() string

GetTFVCProject returns the TFVCProject field if it's non-nil, zero value otherwise.

func (*Import) GetURL Uses

func (i *Import) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Import) GetUseLFS Uses

func (i *Import) GetUseLFS() string

GetUseLFS returns the UseLFS field if it's non-nil, zero value otherwise.

func (*Import) GetVCS Uses

func (i *Import) GetVCS() string

GetVCS returns the VCS field if it's non-nil, zero value otherwise.

func (*Import) GetVCSPassword Uses

func (i *Import) GetVCSPassword() string

GetVCSPassword returns the VCSPassword field if it's non-nil, zero value otherwise.

func (*Import) GetVCSURL Uses

func (i *Import) GetVCSURL() string

GetVCSURL returns the VCSURL field if it's non-nil, zero value otherwise.

func (*Import) GetVCSUsername Uses

func (i *Import) GetVCSUsername() string

GetVCSUsername returns the VCSUsername field if it's non-nil, zero value otherwise.

func (Import) String Uses

func (i Import) String() string

type Installation Uses

type Installation struct {
    ID              *int    `json:"id,omitempty"`
    Account         *User   `json:"account,omitempty"`
    AccessTokensURL *string `json:"access_tokens_url,omitempty"`
    RepositoriesURL *string `json:"repositories_url,omitempty"`
    HTMLURL         *string `json:"html_url,omitempty"`
}

Installation represents a GitHub integration installation.

func (*Installation) GetAccessTokensURL Uses

func (i *Installation) GetAccessTokensURL() string

GetAccessTokensURL returns the AccessTokensURL field if it's non-nil, zero value otherwise.

func (*Installation) GetHTMLURL Uses

func (i *Installation) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Installation) GetID Uses

func (i *Installation) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Installation) GetRepositoriesURL Uses

func (i *Installation) GetRepositoriesURL() string

GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise.

func (Installation) String Uses

func (i Installation) String() string

type IntegrationInstallationEvent Uses

type IntegrationInstallationEvent struct {
    // The action that was performed. Possible values for an "integration_installation"
    // event are: "created", "deleted".
    Action       *string       `json:"action,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

IntegrationInstallationEvent is triggered when an integration is created or deleted. The Webhook event name is "integration_installation".

GitHub API docs: https://developer.github.com/early-access/integrations/webhooks/#integrationinstallationevent

func (*IntegrationInstallationEvent) GetAction Uses

func (i *IntegrationInstallationEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type IntegrationInstallationRepositoriesEvent Uses

type IntegrationInstallationRepositoriesEvent struct {
    // The action that was performed. Possible values for an "integration_installation_repositories"
    // event are: "added", "removed".
    Action              *string       `json:"action,omitempty"`
    RepositoriesAdded   []*Repository `json:"repositories_added,omitempty"`
    RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"`
    Sender              *User         `json:"sender,omitempty"`
    Installation        *Installation `json:"installation,omitempty"`
}

IntegrationInstallationRepositoriesEvent is triggered when an integration repository is added or removed. The Webhook event name is "integration_installation_repositories".

GitHub API docs: https://developer.github.com/early-access/integrations/webhooks/#integrationinstallationrepositoriesevent

func (*IntegrationInstallationRepositoriesEvent) GetAction Uses

func (i *IntegrationInstallationRepositoriesEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type IntegrationsService Uses

type IntegrationsService service

IntegrationsService provides access to the installation related functions in the GitHub API.

GitHub API docs: https://developer.github.com/v3/integrations/

func (*IntegrationsService) ListInstallations Uses

func (s *IntegrationsService) ListInstallations(ctx context.Context, opt *ListOptions) ([]*Installation, *Response, error)

ListInstallations lists the installations that the current integration has.

GitHub API docs: https://developer.github.com/v3/integrations/#find-installations

func (*IntegrationsService) ListRepos Uses

func (s *IntegrationsService) ListRepos(ctx context.Context, opt *ListOptions) ([]*Repository, *Response, error)

ListRepos lists the repositories that the current installation has access to.

GitHub API docs: https://developer.github.com/v3/integrations/installations/#list-repositories

type Invitation Uses

type Invitation struct {
    ID    *int    `json:"id,omitempty"`
    Login *string `json:"login,omitempty"`
    Email *string `json:"email,omitempty"`
    // Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'.
    Role      *string    `json:"role,omitempty"`
    CreatedAt *time.Time `json:"created_at,omitempty"`
    Inviter   *User      `json:"inviter,omitempty"`
}

Invitation represents a team member's invitation status.

func (*Invitation) GetCreatedAt Uses

func (i *Invitation) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Invitation) GetEmail Uses

func (i *Invitation) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*Invitation) GetID Uses

func (i *Invitation) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Invitation) GetLogin Uses

func (i *Invitation) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*Invitation) GetRole Uses

func (i *Invitation) GetRole() string

GetRole returns the Role field if it's non-nil, zero value otherwise.

func (Invitation) String Uses

func (i Invitation) String() string

type Issue Uses

type Issue struct {
    ID               *int              `json:"id,omitempty"`
    Number           *int              `json:"number,omitempty"`
    State            *string           `json:"state,omitempty"`
    Locked           *bool             `json:"locked,omitempty"`
    Title            *string           `json:"title,omitempty"`
    Body             *string           `json:"body,omitempty"`
    User             *User             `json:"user,omitempty"`
    Labels           []Label           `json:"labels,omitempty"`
    Assignee         *User             `json:"assignee,omitempty"`
    Comments         *int              `json:"comments,omitempty"`
    ClosedAt         *time.Time        `json:"closed_at,omitempty"`
    CreatedAt        *time.Time        `json:"created_at,omitempty"`
    UpdatedAt        *time.Time        `json:"updated_at,omitempty"`
    ClosedBy         *User             `json:"closed_by,omitempty"`
    URL              *string           `json:"url,omitempty"`
    HTMLURL          *string           `json:"html_url,omitempty"`
    Milestone        *Milestone        `json:"milestone,omitempty"`
    PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"`
    Repository       *Repository       `json:"repository,omitempty"`
    Reactions        *Reactions        `json:"reactions,omitempty"`
    Assignees        []*User           `json:"assignees,omitempty"`

    // TextMatches is only populated from search results that request text matches
    // See: search.go and https://developer.github.com/v3/search/#text-match-metadata
    TextMatches []TextMatch `json:"text_matches,omitempty"`
}

Issue represents a GitHub issue on a repository.

Note: As far as the GitHub API is concerned, every pull request is an issue, but not every issue is a pull request. Some endpoints, events, and webhooks may also return pull requests via this struct. If PullRequestLinks is nil, this is an issue, and if PullRequestLinks is not nil, this is a pull request.

func (*Issue) GetBody Uses

func (i *Issue) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*Issue) GetClosedAt Uses

func (i *Issue) GetClosedAt() time.Time

GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.

func (*Issue) GetComments Uses

func (i *Issue) GetComments() int

GetComments returns the Comments field if it's non-nil, zero value otherwise.

func (*Issue) GetCreatedAt Uses

func (i *Issue) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Issue) GetHTMLURL Uses

func (i *Issue) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Issue) GetID Uses

func (i *Issue) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Issue) GetLocked Uses

func (i *Issue) GetLocked() bool

GetLocked returns the Locked field if it's non-nil, zero value otherwise.

func (*Issue) GetNumber Uses

func (i *Issue) GetNumber() int

GetNumber returns the Number field if it's non-nil, zero value otherwise.

func (*Issue) GetState Uses

func (i *Issue) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Issue) GetTitle Uses

func (i *Issue) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*Issue) GetURL Uses

func (i *Issue) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Issue) GetUpdatedAt Uses

func (i *Issue) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Issue) String Uses

func (i Issue) String() string

type IssueComment Uses

type IssueComment struct {
    ID        *int       `json:"id,omitempty"`
    Body      *string    `json:"body,omitempty"`
    User      *User      `json:"user,omitempty"`
    Reactions *Reactions `json:"reactions,omitempty"`
    CreatedAt *time.Time `json:"created_at,omitempty"`
    UpdatedAt *time.Time `json:"updated_at,omitempty"`
    URL       *string    `json:"url,omitempty"`
    HTMLURL   *string    `json:"html_url,omitempty"`
    IssueURL  *string    `json:"issue_url,omitempty"`
}

IssueComment represents a comment left on an issue.

func (*IssueComment) GetBody Uses

func (i *IssueComment) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*IssueComment) GetCreatedAt Uses

func (i *IssueComment) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*IssueComment) GetHTMLURL Uses

func (i *IssueComment) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*IssueComment) GetID Uses

func (i *IssueComment) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*IssueComment) GetIssueURL Uses

func (i *IssueComment) GetIssueURL() string

GetIssueURL returns the IssueURL field if it's non-nil, zero value otherwise.

func (*IssueComment) GetURL Uses

func (i *IssueComment) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*IssueComment) GetUpdatedAt Uses

func (i *IssueComment) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (IssueComment) String Uses

func (i IssueComment) String() string

type IssueCommentEvent Uses

type IssueCommentEvent struct {
    // Action is the action that was performed on the comment.
    // Possible values are: "created", "edited", "deleted".
    Action  *string       `json:"action,omitempty"`
    Issue   *Issue        `json:"issue,omitempty"`
    Comment *IssueComment `json:"comment,omitempty"`

    // The following fields are only populated by Webhook events.
    Changes      *EditChange   `json:"changes,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

IssueCommentEvent is triggered when an issue comment is created on an issue or pull request. The Webhook event name is "issue_comment".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#issuecommentevent

func (*IssueCommentEvent) GetAction Uses

func (i *IssueCommentEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type IssueEvent Uses

type IssueEvent struct {
    ID  *int    `json:"id,omitempty"`
    URL *string `json:"url,omitempty"`

    // The User that generated this event.
    Actor *User `json:"actor,omitempty"`

    // Event identifies the actual type of Event that occurred. Possible
    // values are:
    //
    //     closed
    //       The Actor closed the issue.
    //       If the issue was closed by commit message, CommitID holds the SHA1 hash of the commit.
    //
    //     merged
    //       The Actor merged into master a branch containing a commit mentioning the issue.
    //       CommitID holds the SHA1 of the merge commit.
    //
    //     referenced
    //       The Actor committed to master a commit mentioning the issue in its commit message.
    //       CommitID holds the SHA1 of the commit.
    //
    //     reopened, locked, unlocked
    //       The Actor did that to the issue.
    //
    //     renamed
    //       The Actor changed the issue title from Rename.From to Rename.To.
    //
    //     mentioned
    //       Someone unspecified @mentioned the Actor [sic] in an issue comment body.
    //
    //     assigned, unassigned
    //       The Actor assigned the issue to or removed the assignment from the Assignee.
    //
    //     labeled, unlabeled
    //       The Actor added or removed the Label from the issue.
    //
    //     milestoned, demilestoned
    //       The Actor added or removed the issue from the Milestone.
    //
    //     subscribed, unsubscribed
    //       The Actor subscribed to or unsubscribed from notifications for an issue.
    //
    //     head_ref_deleted, head_ref_restored
    //       The pull request’s branch was deleted or restored.
    //
    Event *string `json:"event,omitempty"`

    CreatedAt *time.Time `json:"created_at,omitempty"`
    Issue     *Issue     `json:"issue,omitempty"`

    // Only present on certain events; see above.
    Assignee  *User      `json:"assignee,omitempty"`
    CommitID  *string    `json:"commit_id,omitempty"`
    Milestone *Milestone `json:"milestone,omitempty"`
    Label     *Label     `json:"label,omitempty"`
    Rename    *Rename    `json:"rename,omitempty"`
}

IssueEvent represents an event that occurred around an Issue or Pull Request.

func (*IssueEvent) GetCommitID Uses

func (i *IssueEvent) GetCommitID() string

GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.

func (*IssueEvent) GetCreatedAt Uses

func (i *IssueEvent) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*IssueEvent) GetEvent Uses

func (i *IssueEvent) GetEvent() string

GetEvent returns the Event field if it's non-nil, zero value otherwise.

func (*IssueEvent) GetID Uses

func (i *IssueEvent) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*IssueEvent) GetURL Uses

func (i *IssueEvent) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type IssueListByRepoOptions Uses

type IssueListByRepoOptions struct {
    // Milestone limits issues for the specified milestone. Possible values are
    // a milestone number, "none" for issues with no milestone, "*" for issues
    // with any milestone.
    Milestone string `url:"milestone,omitempty"`

    // State filters issues based on their state. Possible values are: open,
    // closed, all. Default is "open".
    State string `url:"state,omitempty"`

    // Assignee filters issues based on their assignee. Possible values are a
    // user name, "none" for issues that are not assigned, "*" for issues with
    // any assigned user.
    Assignee string `url:"assignee,omitempty"`

    // Creator filters issues based on their creator.
    Creator string `url:"creator,omitempty"`

    // Mentioned filters issues to those mentioned a specific user.
    Mentioned string `url:"mentioned,omitempty"`

    // Labels filters issues based on their label.
    Labels []string `url:"labels,omitempty,comma"`

    // Sort specifies how to sort issues. Possible values are: created, updated,
    // and comments. Default value is "created".
    Sort string `url:"sort,omitempty"`

    // Direction in which to sort issues. Possible values are: asc, desc.
    // Default is "desc".
    Direction string `url:"direction,omitempty"`

    // Since filters issues by time.
    Since time.Time `url:"since,omitempty"`

    ListOptions
}

IssueListByRepoOptions specifies the optional parameters to the IssuesService.ListByRepo method.

type IssueListCommentsOptions Uses

type IssueListCommentsOptions struct {
    // Sort specifies how to sort comments. Possible values are: created, updated.
    Sort string `url:"sort,omitempty"`

    // Direction in which to sort comments. Possible values are: asc, desc.
    Direction string `url:"direction,omitempty"`

    // Since filters comments by time.
    Since time.Time `url:"since,omitempty"`

    ListOptions
}

IssueListCommentsOptions specifies the optional parameters to the IssuesService.ListComments method.

type IssueListOptions Uses

type IssueListOptions struct {
    // Filter specifies which issues to list. Possible values are: assigned,
    // created, mentioned, subscribed, all. Default is "assigned".
    Filter string `url:"filter,omitempty"`

    // State filters issues based on their state. Possible values are: open,
    // closed, all. Default is "open".
    State string `url:"state,omitempty"`

    // Labels filters issues based on their label.
    Labels []string `url:"labels,comma,omitempty"`

    // Sort specifies how to sort issues. Possible values are: created, updated,
    // and comments. Default value is "created".
    Sort string `url:"sort,omitempty"`

    // Direction in which to sort issues. Possible values are: asc, desc.
    // Default is "desc".
    Direction string `url:"direction,omitempty"`

    // Since filters issues by time.
    Since time.Time `url:"since,omitempty"`

    ListOptions
}

IssueListOptions specifies the optional parameters to the IssuesService.List and IssuesService.ListByOrg methods.

type IssueRequest Uses

type IssueRequest struct {
    Title     *string   `json:"title,omitempty"`
    Body      *string   `json:"body,omitempty"`
    Labels    *[]string `json:"labels,omitempty"`
    Assignee  *string   `json:"assignee,omitempty"`
    State     *string   `json:"state,omitempty"`
    Milestone *int      `json:"milestone,omitempty"`
    Assignees *[]string `json:"assignees,omitempty"`
}

IssueRequest represents a request to create/edit an issue. It is separate from Issue above because otherwise Labels and Assignee fail to serialize to the correct JSON.

func (*IssueRequest) GetAssignee Uses

func (i *IssueRequest) GetAssignee() string

GetAssignee returns the Assignee field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetAssignees Uses

func (i *IssueRequest) GetAssignees() []string

GetAssignees returns the Assignees field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetBody Uses

func (i *IssueRequest) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetLabels Uses

func (i *IssueRequest) GetLabels() []string

GetLabels returns the Labels field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetMilestone Uses

func (i *IssueRequest) GetMilestone() int

GetMilestone returns the Milestone field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetState Uses

func (i *IssueRequest) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*IssueRequest) GetTitle Uses

func (i *IssueRequest) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type IssuesEvent Uses

type IssuesEvent struct {
    // Action is the action that was performed. Possible values are: "assigned",
    // "unassigned", "labeled", "unlabeled", "opened", "closed", "reopened", "edited".
    Action   *string `json:"action,omitempty"`
    Issue    *Issue  `json:"issue,omitempty"`
    Assignee *User   `json:"assignee,omitempty"`
    Label    *Label  `json:"label,omitempty"`

    // The following fields are only populated by Webhook events.
    Changes      *EditChange   `json:"changes,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

IssuesEvent is triggered when an issue is assigned, unassigned, labeled, unlabeled, opened, closed, or reopened. The Webhook event name is "issues".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#issuesevent

func (*IssuesEvent) GetAction Uses

func (i *IssuesEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type IssuesSearchResult Uses

type IssuesSearchResult struct {
    Total             *int    `json:"total_count,omitempty"`
    IncompleteResults *bool   `json:"incomplete_results,omitempty"`
    Issues            []Issue `json:"items,omitempty"`
}

IssuesSearchResult represents the result of an issues search.

func (*IssuesSearchResult) GetIncompleteResults Uses

func (i *IssuesSearchResult) GetIncompleteResults() bool

GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.

func (*IssuesSearchResult) GetTotal Uses

func (i *IssuesSearchResult) GetTotal() int

GetTotal returns the Total field if it's non-nil, zero value otherwise.

type IssuesService Uses

type IssuesService service

IssuesService handles communication with the issue related methods of the GitHub API.

GitHub API docs: https://developer.github.com/v3/issues/

func (*IssuesService) AddAssignees Uses

func (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error)

AddAssignees adds the provided GitHub users as assignees to the issue.

GitHub API docs: https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue

func (*IssuesService) AddLabelsToIssue Uses

func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error)

AddLabelsToIssue adds labels to an issue.

GitHub API docs: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue

func (*IssuesService) Create Uses

func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error)

Create a new issue on the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/#create-an-issue

func (*IssuesService) CreateComment Uses

func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error)

CreateComment creates a new comment on the specified issue.

GitHub API docs: https://developer.github.com/v3/issues/comments/#create-a-comment

func (*IssuesService) CreateLabel Uses

func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error)

CreateLabel creates a new label on the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/labels/#create-a-label

func (*IssuesService) CreateMilestone Uses

func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error)

CreateMilestone creates a new milestone on the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/milestones/#create-a-milestone

func (*IssuesService) DeleteComment Uses

func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, id int) (*Response, error)

DeleteComment deletes an issue comment.

GitHub API docs: https://developer.github.com/v3/issues/comments/#delete-a-comment

func (*IssuesService) DeleteLabel Uses

func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error)

DeleteLabel deletes a label.

GitHub API docs: https://developer.github.com/v3/issues/labels/#delete-a-label

func (*IssuesService) DeleteMilestone Uses

func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error)

DeleteMilestone deletes a milestone.

GitHub API docs: https://developer.github.com/v3/issues/milestones/#delete-a-milestone

func (*IssuesService) Edit Uses

func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error)

Edit an issue.

GitHub API docs: https://developer.github.com/v3/issues/#edit-an-issue

func (*IssuesService) EditComment Uses

func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, id int, comment *IssueComment) (*IssueComment, *Response, error)

EditComment updates an issue comment.

GitHub API docs: https://developer.github.com/v3/issues/comments/#edit-a-comment

func (*IssuesService) EditLabel Uses

func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error)

EditLabel edits a label.

GitHub API docs: https://developer.github.com/v3/issues/labels/#update-a-label

func (*IssuesService) EditMilestone Uses

func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error)

EditMilestone edits a milestone.

GitHub API docs: https://developer.github.com/v3/issues/milestones/#update-a-milestone

func (*IssuesService) Get Uses

func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error)

Get a single issue.

GitHub API docs: https://developer.github.com/v3/issues/#get-a-single-issue

func (*IssuesService) GetComment Uses

func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, id int) (*IssueComment, *Response, error)

GetComment fetches the specified issue comment.

GitHub API docs: https://developer.github.com/v3/issues/comments/#get-a-single-comment

func (*IssuesService) GetEvent Uses

func (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int) (*IssueEvent, *Response, error)

GetEvent returns the specified issue event.

GitHub API docs: https://developer.github.com/v3/issues/events/#get-a-single-event

func (*IssuesService) GetLabel Uses

func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error)

GetLabel gets a single label.

GitHub API docs: https://developer.github.com/v3/issues/labels/#get-a-single-label

func (*IssuesService) GetMilestone Uses

func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error)

GetMilestone gets a single milestone.

GitHub API docs: https://developer.github.com/v3/issues/milestones/#get-a-single-milestone

func (*IssuesService) IsAssignee Uses

func (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error)

IsAssignee checks if a user is an assignee for the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/assignees/#check-assignee

func (*IssuesService) List Uses

func (s *IssuesService) List(ctx context.Context, all bool, opt *IssueListOptions) ([]*Issue, *Response, error)

List the issues for the authenticated user. If all is true, list issues across all the user's visible repositories including owned, member, and organization repositories; if false, list only owned and member repositories.

GitHub API docs: https://developer.github.com/v3/issues/#list-issues

func (*IssuesService) ListAssignees Uses

func (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opt *ListOptions) ([]*User, *Response, error)

ListAssignees fetches all available assignees (owners and collaborators) to which issues may be assigned.

GitHub API docs: https://developer.github.com/v3/issues/assignees/#list-assignees

func (*IssuesService) ListByOrg Uses

func (s *IssuesService) ListByOrg(ctx context.Context, org string, opt *IssueListOptions) ([]*Issue, *Response, error)

ListByOrg fetches the issues in the specified organization for the authenticated user.

GitHub API docs: https://developer.github.com/v3/issues/#list-issues

func (*IssuesService) ListByRepo Uses

func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opt *IssueListByRepoOptions) ([]*Issue, *Response, error)

ListByRepo lists the issues for the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/#list-issues-for-a-repository

func (*IssuesService) ListComments Uses

func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opt *IssueListCommentsOptions) ([]*IssueComment, *Response, error)

ListComments lists all comments on the specified issue. Specifying an issue number of 0 will return all comments on all issues for the repository.

GitHub API docs: https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue

func (*IssuesService) ListIssueEvents Uses

func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*IssueEvent, *Response, error)

ListIssueEvents lists events for the specified issue.

GitHub API docs: https://developer.github.com/v3/issues/events/#list-events-for-an-issue

func (*IssuesService) ListIssueTimeline Uses

func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opt *ListOptions) ([]*Timeline, *Response, error)

ListIssueTimeline lists events for the specified issue.

GitHub API docs: https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue

func (*IssuesService) ListLabels Uses

func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opt *ListOptions) ([]*Label, *Response, error)

ListLabels lists all labels for a repository.

GitHub API docs: https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository

func (*IssuesService) ListLabelsByIssue Uses

func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error)

ListLabelsByIssue lists all labels for an issue.

GitHub API docs: https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue

func (*IssuesService) ListLabelsForMilestone Uses

func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error)

ListLabelsForMilestone lists labels for every issue in a milestone.

GitHub API docs: https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone

func (*IssuesService) ListMilestones Uses

func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opt *MilestoneListOptions) ([]*Milestone, *Response, error)

ListMilestones lists all milestones for a repository.

GitHub API docs: https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository

func (*IssuesService) ListRepositoryEvents Uses

func (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opt *ListOptions) ([]*IssueEvent, *Response, error)

ListRepositoryEvents lists events for the specified repository.

GitHub API docs: https://developer.github.com/v3/issues/events/#list-events-for-a-repository

func (*IssuesService) Lock Uses

func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int) (*Response, error)

Lock an issue's conversation.

GitHub API docs: https://developer.github.com/v3/issues/#lock-an-issue

func (*IssuesService) RemoveAssignees Uses

func (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error)

RemoveAssignees removes the provided GitHub users as assignees from the issue.

GitHub API docs: https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue

func (*IssuesService) RemoveLabelForIssue Uses

func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error)

RemoveLabelForIssue removes a label for an issue.

GitHub API docs: https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue

func (*IssuesService) RemoveLabelsForIssue Uses

func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error)

RemoveLabelsForIssue removes all labels for an issue.

GitHub API docs: https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue

func (*IssuesService) ReplaceLabelsForIssue Uses

func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error)

ReplaceLabelsForIssue replaces all labels for an issue.

GitHub API docs: https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue

func (*IssuesService) Unlock Uses

func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error)

Unlock an issue's conversation.

GitHub API docs: https://developer.github.com/v3/issues/#unlock-an-issue

type Key Uses

type Key struct {
    ID       *int    `json:"id,omitempty"`
    Key      *string `json:"key,omitempty"`
    URL      *string `json:"url,omitempty"`
    Title    *string `json:"title,omitempty"`
    ReadOnly *bool   `json:"read_only,omitempty"`
}

Key represents a public SSH key used to authenticate a user or deploy script.

func (*Key) GetID Uses

func (k *Key) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Key) GetKey Uses

func (k *Key) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*Key) GetReadOnly Uses

func (k *Key) GetReadOnly() bool

GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise.

func (*Key) GetTitle Uses

func (k *Key) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*Key) GetURL Uses

func (k *Key) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (Key) String Uses

func (k Key) String() string

type Label Uses

type Label struct {
    ID    *int    `json:"id,omitempty"`
    URL   *string `json:"url,omitempty"`
    Name  *string `json:"name,omitempty"`
    Color *string `json:"color,omitempty"`
}

Label represents a GitHub label on an Issue

func (*Label) GetColor Uses

func (l *Label) GetColor() string

GetColor returns the Color field if it's non-nil, zero value otherwise.

func (*Label) GetID Uses

func (l *Label) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Label) GetName Uses

func (l *Label) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Label) GetURL Uses

func (l *Label) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (Label) String Uses

func (l Label) String() string

type LabelEvent Uses

type LabelEvent struct {
    // Action is the action that was performed. Possible values are:
    // "created", "edited", "deleted"
    Action *string `json:"action,omitempty"`
    Label  *Label  `json:"label,omitempty"`

    // The following fields are only populated by Webhook events.
    Changes      *EditChange   `json:"changes,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Org          *Organization `json:"organization,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

LabelEvent is triggered when a repository's label is created, edited, or deleted. The Webhook event name is "label"

GitHub API docs: https://developer.github.com/v3/activity/events/types/#labelevent

func (*LabelEvent) GetAction Uses

func (l *LabelEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type LargeFile Uses

type LargeFile struct {
    RefName *string `json:"ref_name,omitempty"`
    Path    *string `json:"path,omitempty"`
    OID     *string `json:"oid,omitempty"`
    Size    *int    `json:"size,omitempty"`
}

LargeFile identifies a file larger than 100MB found during a repository import.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-large-files

func (*LargeFile) GetOID Uses

func (l *LargeFile) GetOID() string

GetOID returns the OID field if it's non-nil, zero value otherwise.

func (*LargeFile) GetPath Uses

func (l *LargeFile) GetPath() string

GetPath returns the Path field if it's non-nil, zero value otherwise.

func (*LargeFile) GetRefName Uses

func (l *LargeFile) GetRefName() string

GetRefName returns the RefName field if it's non-nil, zero value otherwise.

func (*LargeFile) GetSize Uses

func (l *LargeFile) GetSize() int

GetSize returns the Size field if it's non-nil, zero value otherwise.

func (LargeFile) String Uses

func (f LargeFile) String() string

type License Uses

type License struct {
    Key  *string `json:"key,omitempty"`
    Name *string `json:"name,omitempty"`
    URL  *string `json:"url,omitempty"`

    SPDXID         *string   `json:"spdx_id,omitempty"`
    HTMLURL        *string   `json:"html_url,omitempty"`
    Featured       *bool     `json:"featured,omitempty"`
    Description    *string   `json:"description,omitempty"`
    Implementation *string   `json:"implementation,omitempty"`
    Permissions    *[]string `json:"permissions,omitempty"`
    Conditions     *[]string `json:"conditions,omitempty"`
    Limitations    *[]string `json:"limitations,omitempty"`
    Body           *string   `json:"body,omitempty"`
}

License represents an open source license.

func (*License) GetBody Uses

func (l *License) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*License) GetConditions Uses

func (l *License) GetConditions() []string

GetConditions returns the Conditions field if it's non-nil, zero value otherwise.

func (*License) GetDescription Uses

func (l *License) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*License) GetFeatured Uses

func (l *License) GetFeatured() bool

GetFeatured returns the Featured field if it's non-nil, zero value otherwise.

func (*License) GetHTMLURL Uses

func (l *License) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*License) GetImplementation Uses

func (l *License) GetImplementation() string

GetImplementation returns the Implementation field if it's non-nil, zero value otherwise.

func (*License) GetKey Uses

func (l *License) GetKey() string

GetKey returns the Key field if it's non-nil, zero value otherwise.

func (*License) GetLimitations Uses

func (l *License) GetLimitations() []string

GetLimitations returns the Limitations field if it's non-nil, zero value otherwise.

func (*License) GetName Uses

func (l *License) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*License) GetPermissions Uses

func (l *License) GetPermissions() []string

GetPermissions returns the Permissions field if it's non-nil, zero value otherwise.

func (*License) GetSPDXID Uses

func (l *License) GetSPDXID() string

GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise.

func (*License) GetURL Uses

func (l *License) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (License) String Uses

func (l License) String() string

type LicensesService Uses

type LicensesService service

LicensesService handles communication with the license related methods of the GitHub API.

GitHub API docs: https://developer.github.com/v3/licenses/

func (*LicensesService) Get Uses

func (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error)

Get extended metadata for one license.

GitHub API docs: https://developer.github.com/v3/licenses/#get-an-individual-license

func (*LicensesService) List Uses

func (s *LicensesService) List(ctx context.Context) ([]*License, *Response, error)

List popular open source licenses.

GitHub API docs: https://developer.github.com/v3/licenses/#list-all-licenses

type ListContributorsOptions Uses

type ListContributorsOptions struct {
    // Include anonymous contributors in results or not
    Anon string `url:"anon,omitempty"`

    ListOptions
}

ListContributorsOptions specifies the optional parameters to the RepositoriesService.ListContributors method.

type ListMembersOptions Uses

type ListMembersOptions struct {
    // If true (or if the authenticated user is not an owner of the
    // organization), list only publicly visible members.
    PublicOnly bool `url:"-"`

    // Filter members returned in the list. Possible values are:
    // 2fa_disabled, all. Default is "all".
    Filter string `url:"filter,omitempty"`

    // Role filters members returned by their role in the organization.
    // Possible values are:
    //     all - all members of the organization, regardless of role
    //     admin - organization owners
    //     member - non-organization members
    //
    // Default is "all".
    Role string `url:"role,omitempty"`

    ListOptions
}

ListMembersOptions specifies optional parameters to the OrganizationsService.ListMembers method.

type ListOptions Uses

type ListOptions struct {
    // For paginated result sets, page of results to retrieve.
    Page int `url:"page,omitempty"`

    // For paginated result sets, the number of results to include per page.
    PerPage int `url:"per_page,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ListOrgMembershipsOptions Uses

type ListOrgMembershipsOptions struct {
    // Filter memberships to include only those with the specified state.
    // Possible values are: "active", "pending".
    State string `url:"state,omitempty"`

    ListOptions
}

ListOrgMembershipsOptions specifies optional parameters to the OrganizationsService.ListOrgMemberships method.

type ListOutsideCollaboratorsOptions Uses

type ListOutsideCollaboratorsOptions struct {
    // Filter outside collaborators returned in the list. Possible values are:
    // 2fa_disabled, all.  Default is "all".
    Filter string `url:"filter,omitempty"`

    ListOptions
}

ListOutsideCollaboratorsOptions specifies optional parameters to the OrganizationsService.ListOutsideCollaborators method.

type MarkdownOptions Uses

type MarkdownOptions struct {
    // Mode identifies the rendering mode. Possible values are:
    //   markdown - render a document as plain Markdown, just like
    //   README files are rendered.
    //
    //   gfm - to render a document as user-content, e.g. like user
    //   comments or issues are rendered. In GFM mode, hard line breaks are
    //   always taken into account, and issue and user mentions are linked
    //   accordingly.
    //
    // Default is "markdown".
    Mode string

    // Context identifies the repository context. Only taken into account
    // when rendering as "gfm".
    Context string
}

MarkdownOptions specifies optional parameters to the Markdown method.

type Match Uses

type Match struct {
    Text    *string `json:"text,omitempty"`
    Indices []int   `json:"indices,omitempty"`
}

Match represents a single text match.

func (*Match) GetText Uses

func (m *Match) GetText() string

GetText returns the Text field if it's non-nil, zero value otherwise.

type MemberEvent Uses

type MemberEvent struct {
    // Action is the action that was performed. Possible value is: "added".
    Action *string `json:"action,omitempty"`
    Member *User   `json:"member,omitempty"`

    // The following fields are only populated by Webhook events.
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

MemberEvent is triggered when a user is added as a collaborator to a repository. The Webhook event name is "member".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#memberevent

func (*MemberEvent) GetAction Uses

func (m *MemberEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type Membership Uses

type Membership struct {
    URL *string `json:"url,omitempty"`

    // State is the user's status within the organization or team.
    // Possible values are: "active", "pending"
    State *string `json:"state,omitempty"`

    // Role identifies the user's role within the organization or team.
    // Possible values for organization membership:
    //     member - non-owner organization member
    //     admin - organization owner
    //
    // Possible values for team membership are:
    //     member - a normal member of the team
    //     maintainer - a team maintainer. Able to add/remove other team
    //                  members, promote other team members to team
    //                  maintainer, and edit the team’s name and description
    Role *string `json:"role,omitempty"`

    // For organization membership, the API URL of the organization.
    OrganizationURL *string `json:"organization_url,omitempty"`

    // For organization membership, the organization the membership is for.
    Organization *Organization `json:"organization,omitempty"`

    // For organization membership, the user the membership is for.
    User *User `json:"user,omitempty"`
}

Membership represents the status of a user's membership in an organization or team.

func (*Membership) GetOrganizationURL Uses

func (m *Membership) GetOrganizationURL() string

GetOrganizationURL returns the OrganizationURL field if it's non-nil, zero value otherwise.

func (*Membership) GetRole Uses

func (m *Membership) GetRole() string

GetRole returns the Role field if it's non-nil, zero value otherwise.

func (*Membership) GetState Uses

func (m *Membership) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Membership) GetURL Uses

func (m *Membership) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (Membership) String Uses

func (m Membership) String() string

type MembershipEvent Uses

type MembershipEvent struct {
    // Action is the action that was performed. Possible values are: "added", "removed".
    Action *string `json:"action,omitempty"`
    // Scope is the scope of the membership. Possible value is: "team".
    Scope  *string `json:"scope,omitempty"`
    Member *User   `json:"member,omitempty"`
    Team   *Team   `json:"team,omitempty"`

    // The following fields are only populated by Webhook events.
    Org          *Organization `json:"organization,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

MembershipEvent is triggered when a user is added or removed from a team. The Webhook event name is "membership".

Events of this type are not visible in timelines, they are only used to trigger organization webhooks.

GitHub API docs: https://developer.github.com/v3/activity/events/types/#membershipevent

func (*MembershipEvent) GetAction Uses

func (m *MembershipEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*MembershipEvent) GetScope Uses

func (m *MembershipEvent) GetScope() string

GetScope returns the Scope field if it's non-nil, zero value otherwise.

type Migration Uses

type Migration struct {
    ID   *int    `json:"id,omitempty"`
    GUID *string `json:"guid,omitempty"`
    // State is the current state of a migration.
    // Possible values are:
    //     "pending" which means the migration hasn't started yet,
    //     "exporting" which means the migration is in progress,
    //     "exported" which means the migration finished successfully, or
    //     "failed" which means the migration failed.
    State *string `json:"state,omitempty"`
    // LockRepositories indicates whether repositories are locked (to prevent
    // manipulation) while migrating data.
    LockRepositories *bool `json:"lock_repositories,omitempty"`
    // ExcludeAttachments indicates whether attachments should be excluded from
    // the migration (to reduce migration archive file size).
    ExcludeAttachments *bool         `json:"exclude_attachments,omitempty"`
    URL                *string       `json:"url,omitempty"`
    CreatedAt          *string       `json:"created_at,omitempty"`
    UpdatedAt          *string       `json:"updated_at,omitempty"`
    Repositories       []*Repository `json:"repositories,omitempty"`
}

Migration represents a GitHub migration (archival).

func (*Migration) GetCreatedAt Uses

func (m *Migration) GetCreatedAt() string

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Migration) GetExcludeAttachments Uses

func (m *Migration) GetExcludeAttachments() bool

GetExcludeAttachments returns the ExcludeAttachments field if it's non-nil, zero value otherwise.

func (*Migration) GetGUID Uses

func (m *Migration) GetGUID() string

GetGUID returns the GUID field if it's non-nil, zero value otherwise.

func (*Migration) GetID Uses

func (m *Migration) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Migration) GetLockRepositories Uses

func (m *Migration) GetLockRepositories() bool

GetLockRepositories returns the LockRepositories field if it's non-nil, zero value otherwise.

func (*Migration) GetState Uses

func (m *Migration) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Migration) GetURL Uses

func (m *Migration) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Migration) GetUpdatedAt Uses

func (m *Migration) GetUpdatedAt() string

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Migration) String Uses

func (m Migration) String() string

type MigrationOptions Uses

type MigrationOptions struct {
    // LockRepositories indicates whether repositories should be locked (to prevent
    // manipulation) while migrating data.
    LockRepositories bool

    // ExcludeAttachments indicates whether attachments should be excluded from
    // the migration (to reduce migration archive file size).
    ExcludeAttachments bool
}

MigrationOptions specifies the optional parameters to Migration methods.

type MigrationService Uses

type MigrationService service

MigrationService provides access to the migration related functions in the GitHub API.

GitHub API docs: https://developer.github.com/v3/migration/

func (*MigrationService) CancelImport Uses

func (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error)

CancelImport stops an import for a repository.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#cancel-an-import

func (*MigrationService) CommitAuthors Uses

func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error)

CommitAuthors gets the authors mapped from the original repository.

Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username "hubot" into something like "hubot <hubot@12341234-abab-fefe-8787-fedcba987654>".

This method and MapCommitAuthor allow you to provide correct Git author information.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-commit-authors

func (*MigrationService) DeleteMigration Uses

func (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int) (*Response, error)

DeleteMigration deletes a previous migration archive. id is the migration ID.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#delete-a-migration-archive

func (*MigrationService) ImportProgress Uses

func (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error)

ImportProgress queries for the status and progress of an ongoing repository import.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-import-progress

func (*MigrationService) LargeFiles Uses

func (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error)

LargeFiles lists files larger than 100MB found during the import.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-large-files

func (*MigrationService) ListMigrations Uses

func (s *MigrationService) ListMigrations(ctx context.Context, org string) ([]*Migration, *Response, error)

ListMigrations lists the most recent migrations.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#get-a-list-of-migrations

func (*MigrationService) MapCommitAuthor Uses

func (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error)

MapCommitAuthor updates an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#map-a-commit-author

func (*MigrationService) MigrationArchiveURL Uses

func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int) (url string, err error)

MigrationArchiveURL fetches a migration archive URL. id is the migration ID.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#download-a-migration-archive

func (*MigrationService) MigrationStatus Uses

func (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int) (*Migration, *Response, error)

MigrationStatus gets the status of a specific migration archive. id is the migration ID.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#get-the-status-of-a-migration

func (*MigrationService) SetLFSPreference Uses

func (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)

SetLFSPreference sets whether imported repositories should use Git LFS for files larger than 100MB. Only the UseLFS field on the provided Import is used.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#set-git-lfs-preference

func (*MigrationService) StartImport Uses

func (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)

StartImport initiates a repository import.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#start-an-import

func (*MigrationService) StartMigration Uses

func (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opt *MigrationOptions) (*Migration, *Response, error)

StartMigration starts the generation of a migration archive. repos is a slice of repository names to migrate.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#start-a-migration

func (*MigrationService) UnlockRepo Uses

func (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int, repo string) (*Response, error)

UnlockRepo unlocks a repository that was locked for migration. id is the migration ID. You should unlock each migrated repository and delete them when the migration is complete and you no longer need the source data.

GitHub API docs: https://developer.github.com/v3/migration/migrations/#unlock-a-repository

func (*MigrationService) UpdateImport Uses

func (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error)

UpdateImport initiates a repository import.

GitHub API docs: https://developer.github.com/v3/migration/source_imports/#update-existing-import

type Milestone Uses

type Milestone struct {
    URL          *string    `json:"url,omitempty"`
    HTMLURL      *string    `json:"html_url,omitempty"`
    LabelsURL    *string    `json:"labels_url,omitempty"`
    ID           *int       `json:"id,omitempty"`
    Number       *int       `json:"number,omitempty"`
    State        *string    `json:"state,omitempty"`
    Title        *string    `json:"title,omitempty"`
    Description  *string    `json:"description,omitempty"`
    Creator      *User      `json:"creator,omitempty"`
    OpenIssues   *int       `json:"open_issues,omitempty"`
    ClosedIssues *int       `json:"closed_issues,omitempty"`
    CreatedAt    *time.Time `json:"created_at,omitempty"`
    UpdatedAt    *time.Time `json:"updated_at,omitempty"`
    ClosedAt     *time.Time `json:"closed_at,omitempty"`
    DueOn        *time.Time `json:"due_on,omitempty"`
}

Milestone represents a GitHub repository milestone.

func (*Milestone) GetClosedAt Uses

func (m *Milestone) GetClosedAt() time.Time

GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.

func (*Milestone) GetClosedIssues Uses

func (m *Milestone) GetClosedIssues() int

GetClosedIssues returns the ClosedIssues field if it's non-nil, zero value otherwise.

func (*Milestone) GetCreatedAt Uses

func (m *Milestone) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Milestone) GetDescription Uses

func (m *Milestone) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Milestone) GetDueOn Uses

func (m *Milestone) GetDueOn() time.Time

GetDueOn returns the DueOn field if it's non-nil, zero value otherwise.

func (*Milestone) GetHTMLURL Uses

func (m *Milestone) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Milestone) GetID Uses

func (m *Milestone) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Milestone) GetLabelsURL Uses

func (m *Milestone) GetLabelsURL() string

GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise.

func (*Milestone) GetNumber Uses

func (m *Milestone) GetNumber() int

GetNumber returns the Number field if it's non-nil, zero value otherwise.

func (*Milestone) GetOpenIssues Uses

func (m *Milestone) GetOpenIssues() int

GetOpenIssues returns the OpenIssues field if it's non-nil, zero value otherwise.

func (*Milestone) GetState Uses

func (m *Milestone) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*Milestone) GetTitle Uses

func (m *Milestone) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*Milestone) GetURL Uses

func (m *Milestone) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Milestone) GetUpdatedAt Uses

func (m *Milestone) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Milestone) String Uses

func (m Milestone) String() string

type MilestoneEvent Uses

type MilestoneEvent struct {
    // Action is the action that was performed. Possible values are:
    // "created", "closed", "opened", "edited", "deleted"
    Action    *string    `json:"action,omitempty"`
    Milestone *Milestone `json:"milestone,omitempty"`

    // The following fields are only populated by Webhook events.
    Changes      *EditChange   `json:"changes,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Org          *Organization `json:"organization,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. The Webhook event name is "milestone".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#milestoneevent

func (*MilestoneEvent) GetAction Uses

func (m *MilestoneEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type MilestoneListOptions Uses

type MilestoneListOptions struct {
    // State filters milestones based on their state. Possible values are:
    // open, closed, all. Default is "open".
    State string `url:"state,omitempty"`

    // Sort specifies how to sort milestones. Possible values are: due_on, completeness.
    // Default value is "due_on".
    Sort string `url:"sort,omitempty"`

    // Direction in which to sort milestones. Possible values are: asc, desc.
    // Default is "asc".
    Direction string `url:"direction,omitempty"`

    ListOptions
}

MilestoneListOptions specifies the optional parameters to the IssuesService.ListMilestones method.

type NewPullRequest Uses

type NewPullRequest struct {
    Title               *string `json:"title,omitempty"`
    Head                *string `json:"head,omitempty"`
    Base                *string `json:"base,omitempty"`
    Body                *string `json:"body,omitempty"`
    Issue               *int    `json:"issue,omitempty"`
    MaintainerCanModify *bool   `json:"maintainer_can_modify,omitempty"`
}

NewPullRequest represents a new pull request to be created.

func (*NewPullRequest) GetBase Uses

func (n *NewPullRequest) GetBase() string

GetBase returns the Base field if it's non-nil, zero value otherwise.

func (*NewPullRequest) GetBody Uses

func (n *NewPullRequest) GetBody() string

GetBody returns the Body field if it's non-nil, zero value otherwise.

func (*NewPullRequest) GetHead Uses

func (n *NewPullRequest) GetHead() string

GetHead returns the Head field if it's non-nil, zero value otherwise.

func (*NewPullRequest) GetIssue Uses

func (n *NewPullRequest) GetIssue() int

GetIssue returns the Issue field if it's non-nil, zero value otherwise.

func (*NewPullRequest) GetMaintainerCanModify Uses

func (n *NewPullRequest) GetMaintainerCanModify() bool

GetMaintainerCanModify returns the MaintainerCanModify field if it's non-nil, zero value otherwise.

func (*NewPullRequest) GetTitle Uses

func (n *NewPullRequest) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type Notification Uses

type Notification struct {
    ID         *string              `json:"id,omitempty"`
    Repository *Repository          `json:"repository,omitempty"`
    Subject    *NotificationSubject `json:"subject,omitempty"`

    // Reason identifies the event that triggered the notification.
    //
    // GitHub API docs: https://developer.github.com/v3/activity/notifications/#notification-reasons
    Reason *string `json:"reason,omitempty"`

    Unread     *bool      `json:"unread,omitempty"`
    UpdatedAt  *time.Time `json:"updated_at,omitempty"`
    LastReadAt *time.Time `json:"last_read_at,omitempty"`
    URL        *string    `json:"url,omitempty"`
}

Notification identifies a GitHub notification for a user.

func (*Notification) GetID Uses

func (n *Notification) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Notification) GetLastReadAt Uses

func (n *Notification) GetLastReadAt() time.Time

GetLastReadAt returns the LastReadAt field if it's non-nil, zero value otherwise.

func (*Notification) GetReason Uses

func (n *Notification) GetReason() string

GetReason returns the Reason field if it's non-nil, zero value otherwise.

func (*Notification) GetURL Uses

func (n *Notification) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Notification) GetUnread Uses

func (n *Notification) GetUnread() bool

GetUnread returns the Unread field if it's non-nil, zero value otherwise.

func (*Notification) GetUpdatedAt Uses

func (n *Notification) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type NotificationListOptions Uses

type NotificationListOptions struct {
    All           bool      `url:"all,omitempty"`
    Participating bool      `url:"participating,omitempty"`
    Since         time.Time `url:"since,omitempty"`
    Before        time.Time `url:"before,omitempty"`

    ListOptions
}

NotificationListOptions specifies the optional parameters to the ActivityService.ListNotifications method.

type NotificationSubject Uses

type NotificationSubject struct {
    Title            *string `json:"title,omitempty"`
    URL              *string `json:"url,omitempty"`
    LatestCommentURL *string `json:"latest_comment_url,omitempty"`
    Type             *string `json:"type,omitempty"`
}

NotificationSubject identifies the subject of a notification.

func (*NotificationSubject) GetLatestCommentURL Uses

func (n *NotificationSubject) GetLatestCommentURL() string

GetLatestCommentURL returns the LatestCommentURL field if it's non-nil, zero value otherwise.

func (*NotificationSubject) GetTitle Uses

func (n *NotificationSubject) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*NotificationSubject) GetType Uses

func (n *NotificationSubject) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*NotificationSubject) GetURL Uses

func (n *NotificationSubject) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

type Organization Uses

type Organization struct {
    Login             *string    `json:"login,omitempty"`
    ID                *int       `json:"id,omitempty"`
    AvatarURL         *string    `json:"avatar_url,omitempty"`
    HTMLURL           *string    `json:"html_url,omitempty"`
    Name              *string    `json:"name,omitempty"`
    Company           *string    `json:"company,omitempty"`
    Blog              *string    `json:"blog,omitempty"`
    Location          *string    `json:"location,omitempty"`
    Email             *string    `json:"email,omitempty"`
    Description       *string    `json:"description,omitempty"`
    PublicRepos       *int       `json:"public_repos,omitempty"`
    PublicGists       *int       `json:"public_gists,omitempty"`
    Followers         *int       `json:"followers,omitempty"`
    Following         *int       `json:"following,omitempty"`
    CreatedAt         *time.Time `json:"created_at,omitempty"`
    UpdatedAt         *time.Time `json:"updated_at,omitempty"`
    TotalPrivateRepos *int       `json:"total_private_repos,omitempty"`
    OwnedPrivateRepos *int       `json:"owned_private_repos,omitempty"`
    PrivateGists      *int       `json:"private_gists,omitempty"`
    DiskUsage         *int       `json:"disk_usage,omitempty"`
    Collaborators     *int       `json:"collaborators,omitempty"`
    BillingEmail      *string    `json:"billing_email,omitempty"`
    Type              *string    `json:"type,omitempty"`
    Plan              *Plan      `json:"plan,omitempty"`

    // API URLs
    URL              *string `json:"url,omitempty"`
    EventsURL        *string `json:"events_url,omitempty"`
    HooksURL         *string `json:"hooks_url,omitempty"`
    IssuesURL        *string `json:"issues_url,omitempty"`
    MembersURL       *string `json:"members_url,omitempty"`
    PublicMembersURL *string `json:"public_members_url,omitempty"`
    ReposURL         *string `json:"repos_url,omitempty"`
}

Organization represents a GitHub organization account.

func (*Organization) GetAvatarURL Uses

func (o *Organization) GetAvatarURL() string

GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.

func (*Organization) GetBillingEmail Uses

func (o *Organization) GetBillingEmail() string

GetBillingEmail returns the BillingEmail field if it's non-nil, zero value otherwise.

func (*Organization) GetBlog Uses

func (o *Organization) GetBlog() string

GetBlog returns the Blog field if it's non-nil, zero value otherwise.

func (*Organization) GetCollaborators Uses

func (o *Organization) GetCollaborators() int

GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise.

func (*Organization) GetCompany Uses

func (o *Organization) GetCompany() string

GetCompany returns the Company field if it's non-nil, zero value otherwise.

func (*Organization) GetCreatedAt Uses

func (o *Organization) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Organization) GetDescription Uses

func (o *Organization) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Organization) GetDiskUsage Uses

func (o *Organization) GetDiskUsage() int

GetDiskUsage returns the DiskUsage field if it's non-nil, zero value otherwise.

func (*Organization) GetEmail Uses

func (o *Organization) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*Organization) GetEventsURL Uses

func (o *Organization) GetEventsURL() string

GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.

func (*Organization) GetFollowers Uses

func (o *Organization) GetFollowers() int

GetFollowers returns the Followers field if it's non-nil, zero value otherwise.

func (*Organization) GetFollowing Uses

func (o *Organization) GetFollowing() int

GetFollowing returns the Following field if it's non-nil, zero value otherwise.

func (*Organization) GetHTMLURL Uses

func (o *Organization) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Organization) GetHooksURL Uses

func (o *Organization) GetHooksURL() string

GetHooksURL returns the HooksURL field if it's non-nil, zero value otherwise.

func (*Organization) GetID Uses

func (o *Organization) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Organization) GetIssuesURL Uses

func (o *Organization) GetIssuesURL() string

GetIssuesURL returns the IssuesURL field if it's non-nil, zero value otherwise.

func (*Organization) GetLocation Uses

func (o *Organization) GetLocation() string

GetLocation returns the Location field if it's non-nil, zero value otherwise.

func (*Organization) GetLogin Uses

func (o *Organization) GetLogin() string

GetLogin returns the Login field if it's non-nil, zero value otherwise.

func (*Organization) GetMembersURL Uses

func (o *Organization) GetMembersURL() string

GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise.

func (*Organization) GetName Uses

func (o *Organization) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Organization) GetOwnedPrivateRepos Uses

func (o *Organization) GetOwnedPrivateRepos() int

GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise.

func (*Organization) GetPrivateGists Uses

func (o *Organization) GetPrivateGists() int

GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise.

func (*Organization) GetPublicGists Uses

func (o *Organization) GetPublicGists() int

GetPublicGists returns the PublicGists field if it's non-nil, zero value otherwise.

func (*Organization) GetPublicMembersURL Uses

func (o *Organization) GetPublicMembersURL() string

GetPublicMembersURL returns the PublicMembersURL field if it's non-nil, zero value otherwise.

func (*Organization) GetPublicRepos Uses

func (o *Organization) GetPublicRepos() int

GetPublicRepos returns the PublicRepos field if it's non-nil, zero value otherwise.

func (*Organization) GetReposURL Uses

func (o *Organization) GetReposURL() string

GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.

func (*Organization) GetTotalPrivateRepos Uses

func (o *Organization) GetTotalPrivateRepos() int

GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise.

func (*Organization) GetType Uses

func (o *Organization) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Organization) GetURL Uses

func (o *Organization) GetURL() string

GetURL returns the URL field if it's non-nil, zero value otherwise.

func (*Organization) GetUpdatedAt Uses

func (o *Organization) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (Organization) String Uses

func (o Organization) String() string

type OrganizationAddTeamMembershipOptions Uses

type OrganizationAddTeamMembershipOptions struct {
    // Role specifies the role the user should have in the team. Possible
    // values are:
    //     member - a normal member of the team
    //     maintainer - a team maintainer. Able to add/remove other team
    //                  members, promote other team members to team
    //                  maintainer, and edit the team’s name and description
    //
    // Default value is "member".
    Role string `json:"role,omitempty"`
}

OrganizationAddTeamMembershipOptions does stuff specifies the optional parameters to the OrganizationsService.AddTeamMembership method.

type OrganizationAddTeamRepoOptions Uses

type OrganizationAddTeamRepoOptions struct {
    // Permission specifies the permission to grant the team on this repository.
    // Possible values are:
    //     pull - team members can pull, but not push to or administer this repository
    //     push - team members can pull and push, but not administer this repository
    //     admin - team members can pull, push and administer this repository
    //
    // If not specified, the team's permission attribute will be used.
    Permission string `json:"permission,omitempty"`
}

OrganizationAddTeamRepoOptions specifies the optional parameters to the OrganizationsService.AddTeamRepo method.

type OrganizationEvent Uses

type OrganizationEvent struct {
    // Action is the action that was performed.
    // Can be one of "member_added", "member_removed", or "member_invited".
    Action *string `json:"action,omitempty"`

    // Invitaion is the invitation for the user or email if the action is "member_invited".
    Invitation *Invitation `json:"invitation,omitempty"`

    // Membership is the membership between the user and the organization.
    // Not present when the action is "member_invited".
    Membership *Membership `json:"membership,omitempty"`

    Organization *Organization `json:"organization,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

OrganizationEvent is triggered when a user is added, removed, or invited to an organization. Events of this type are not visible in timelines. These events are only used to trigger organization hooks. Webhook event name is "organization".

GitHub API docs: https://developer.github.com/v3/activity/events/types/#organizationevent

func (*OrganizationEvent) GetAction Uses

func (o *OrganizationEvent) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

type OrganizationListTeamMembersOptions Uses

type OrganizationListTeamMembersOptions struct {
    // Role filters members returned by their role in the team. Possible
    // values are "all", "member", "maintainer". Default is "all".
    Role string `url:"role,omitempty"`

    ListOptions
}

OrganizationListTeamMembersOptions specifies the optional parameters to the OrganizationsService.ListTeamMembers method.

type OrganizationsListOptions Uses

type OrganizationsListOptions struct {
    // Since filters Organizations by ID.
    Since int `url:"since,omitempty"`

    ListOptions
}

OrganizationsListOptions specifies the optional parameters to the OrganizationsService.ListAll method.

type OrganizationsService Uses

type OrganizationsService service

OrganizationsService provides access to the organization related functions in the GitHub API.

GitHub API docs: https://developer.github.com/v3/orgs/

func (*OrganizationsService) AddTeamMembership Uses

func (s *OrganizationsService) AddTeamMembership(ctx context.Context, team int, user string, opt *OrganizationAddTeamMembershipOptions) (*Membership, *Response, error)

AddTeamMembership adds or invites a user to a team.

In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with.

If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team.

If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#add-team-membership

func (*OrganizationsService) AddTeamRepo Uses

func (s *OrganizationsService) AddTeamRepo(ctx context.Context, team int, owner string, repo string, opt *OrganizationAddTeamRepoOptions) (*Response, error)

AddTeamRepo adds a repository to be managed by the specified team. The specified repository must be owned by the organization to which the team belongs, or a direct fork of a repository owned by the organization.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#add-team-repo

func (*OrganizationsService) ConcealMembership Uses

func (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error)

ConcealMembership conceals a user's membership in an organization.

GitHub API docs: https://developer.github.com/v3/orgs/members/#conceal-a-users-membership

func (*OrganizationsService) CreateHook Uses

func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error)

CreateHook creates a Hook for the specified org. Name and Config are required fields.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#create-a-hook

func (*OrganizationsService) CreateProject Uses

func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opt *ProjectOptions) (*Project, *Response, error)

CreateProject creates a GitHub Project for the specified organization.

GitHub API docs: https://developer.github.com/v3/projects/#create-an-organization-project

func (*OrganizationsService) CreateTeam Uses

func (s *OrganizationsService) CreateTeam(ctx context.Context, org string, team *Team) (*Team, *Response, error)

CreateTeam creates a new team within an organization.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#create-team

func (*OrganizationsService) DeleteHook Uses

func (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int) (*Response, error)

DeleteHook deletes a specified Hook.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#delete-a-hook

func (*OrganizationsService) DeleteTeam Uses

func (s *OrganizationsService) DeleteTeam(ctx context.Context, team int) (*Response, error)

DeleteTeam deletes a team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#delete-team

func (*OrganizationsService) Edit Uses

func (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error)

Edit an organization.

GitHub API docs: https://developer.github.com/v3/orgs/#edit-an-organization

func (*OrganizationsService) EditHook Uses

func (s *OrganizationsService) EditHook(ctx context.Context, org string, id int, hook *Hook) (*Hook, *Response, error)

EditHook updates a specified Hook.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#edit-a-hook

func (*OrganizationsService) EditOrgMembership Uses

func (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error)

EditOrgMembership edits the membership for user in specified organization. Passing an empty string for user will edit the membership for the authenticated user.

GitHub API docs: https://developer.github.com/v3/orgs/members/#add-or-update-organization-membership GitHub API docs: https://developer.github.com/v3/orgs/members/#edit-your-organization-membership

func (*OrganizationsService) EditTeam Uses

func (s *OrganizationsService) EditTeam(ctx context.Context, id int, team *Team) (*Team, *Response, error)

EditTeam edits a team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#edit-team

func (*OrganizationsService) Get Uses

func (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error)

Get fetches an organization by name.

GitHub API docs: https://developer.github.com/v3/orgs/#get-an-organization

func (*OrganizationsService) GetHook Uses

func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int) (*Hook, *Response, error)

GetHook returns a single specified Hook.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#get-single-hook

func (*OrganizationsService) GetOrgMembership Uses

func (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error)

GetOrgMembership gets the membership for a user in a specified organization. Passing an empty string for user will get the membership for the authenticated user.

GitHub API docs: https://developer.github.com/v3/orgs/members/#get-organization-membership https://developer.github.com/v3/orgs/members/#get-your-organization-membership

func (*OrganizationsService) GetTeam Uses

func (s *OrganizationsService) GetTeam(ctx context.Context, team int) (*Team, *Response, error)

GetTeam fetches a team by ID.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team

func (*OrganizationsService) GetTeamMembership Uses

func (s *OrganizationsService) GetTeamMembership(ctx context.Context, team int, user string) (*Membership, *Response, error)

GetTeamMembership returns the membership status for a user in a team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team-membership

func (*OrganizationsService) IsMember Uses

func (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error)

IsMember checks if a user is a member of an organization.

GitHub API docs: https://developer.github.com/v3/orgs/members/#check-membership

func (*OrganizationsService) IsPublicMember Uses

func (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error)

IsPublicMember checks if a user is a public member of an organization.

GitHub API docs: https://developer.github.com/v3/orgs/members/#check-public-membership

func (*OrganizationsService) IsTeamMember Uses

func (s *OrganizationsService) IsTeamMember(ctx context.Context, team int, user string) (bool, *Response, error)

IsTeamMember checks if a user is a member of the specified team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#get-team-member

func (*OrganizationsService) IsTeamRepo Uses

func (s *OrganizationsService) IsTeamRepo(ctx context.Context, team int, owner string, repo string) (*Repository, *Response, error)

IsTeamRepo checks if a team manages the specified repository. If the repository is managed by team, a Repository is returned which includes the permissions team has for that repo.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#check-if-a-team-manages-a-repository

func (*OrganizationsService) List Uses

func (s *OrganizationsService) List(ctx context.Context, user string, opt *ListOptions) ([]*Organization, *Response, error)

List the organizations for a user. Passing the empty string will list organizations for the authenticated user.

GitHub API docs: https://developer.github.com/v3/orgs/#list-user-organizations

func (*OrganizationsService) ListAll Uses

func (s *OrganizationsService) ListAll(ctx context.Context, opt *OrganizationsListOptions) ([]*Organization, *Response, error)

ListAll lists all organizations, in the order that they were created on GitHub.

Note: Pagination is powered exclusively by the since parameter. To continue listing the next set of organizations, use the ID of the last-returned organization as the opts.Since parameter for the next call.

GitHub API docs: https://developer.github.com/v3/orgs/#list-all-organizations

func (*OrganizationsService) ListHooks Uses

func (s *OrganizationsService) ListHooks(ctx context.Context, org string, opt *ListOptions) ([]*Hook, *Response, error)

ListHooks lists all Hooks for the specified organization.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#list-hooks

func (*OrganizationsService) ListMembers Uses

func (s *OrganizationsService) ListMembers(ctx context.Context, org string, opt *ListMembersOptions) ([]*User, *Response, error)

ListMembers lists the members for an organization. If the authenticated user is an owner of the organization, this will return both concealed and public members, otherwise it will only return public members.

GitHub API docs: https://developer.github.com/v3/orgs/members/#members-list

func (*OrganizationsService) ListOrgMemberships Uses

func (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opt *ListOrgMembershipsOptions) ([]*Membership, *Response, error)

ListOrgMemberships lists the organization memberships for the authenticated user.

GitHub API docs: https://developer.github.com/v3/orgs/members/#list-your-organization-memberships

func (*OrganizationsService) ListOutsideCollaborators Uses

func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opt *ListOutsideCollaboratorsOptions) ([]*User, *Response, error)

ListOutsideCollaborators lists outside collaborators of organization's repositories. This will only work if the authenticated user is an owner of the organization.

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use.

GitHub API docs: https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators

func (*OrganizationsService) ListPendingOrgInvitations Uses

func (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org int, opt *ListOptions) ([]*Invitation, *Response, error)

ListPendingOrgInvitations returns a list of pending invitations.

GitHub API docs: https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations

func (*OrganizationsService) ListPendingTeamInvitations Uses

func (s *OrganizationsService) ListPendingTeamInvitations(ctx context.Context, team int, opt *ListOptions) ([]*Invitation, *Response, error)

ListPendingTeamInvitations get pending invitaion list in team. Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-pending-team-invitations

func (*OrganizationsService) ListProjects Uses

func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opt *ProjectListOptions) ([]*Project, *Response, error)

ListProjects lists the projects for an organization.

GitHub API docs: https://developer.github.com/v3/projects/#list-organization-projects

func (*OrganizationsService) ListTeamMembers Uses

func (s *OrganizationsService) ListTeamMembers(ctx context.Context, team int, opt *OrganizationListTeamMembersOptions) ([]*User, *Response, error)

ListTeamMembers lists all of the users who are members of the specified team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-team-members

func (*OrganizationsService) ListTeamRepos Uses

func (s *OrganizationsService) ListTeamRepos(ctx context.Context, team int, opt *ListOptions) ([]*Repository, *Response, error)

ListTeamRepos lists the repositories that the specified team has access to.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-team-repos

func (*OrganizationsService) ListTeams Uses

func (s *OrganizationsService) ListTeams(ctx context.Context, org string, opt *ListOptions) ([]*Team, *Response, error)

ListTeams lists all of the teams for an organization.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-teams

func (*OrganizationsService) ListUserTeams Uses

func (s *OrganizationsService) ListUserTeams(ctx context.Context, opt *ListOptions) ([]*Team, *Response, error)

ListUserTeams lists a user's teams GitHub API docs: https://developer.github.com/v3/orgs/teams/#list-user-teams

func (*OrganizationsService) PingHook Uses

func (s *OrganizationsService) PingHook(ctx context.Context, org string, id int) (*Response, error)

PingHook triggers a 'ping' event to be sent to the Hook.

GitHub API docs: https://developer.github.com/v3/orgs/hooks/#ping-a-hook

func (*OrganizationsService) PublicizeMembership Uses

func (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error)

PublicizeMembership publicizes a user's membership in an organization. (A user cannot publicize the membership for another user.)

GitHub API docs: https://developer.github.com/v3/orgs/members/#publicize-a-users-membership

func (*OrganizationsService) RemoveMember Uses

func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error)

RemoveMember removes a user from all teams of an organization.

GitHub API docs: https://developer.github.com/v3/orgs/members/#remove-a-member

func (*OrganizationsService) RemoveOrgMembership Uses

func (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error)

RemoveOrgMembership removes user from the specified organization. If the user has been invited to the organization, this will cancel their invitation.

GitHub API docs: https://developer.github.com/v3/orgs/members/#remove-organization-membership

func (*OrganizationsService) RemoveTeamMembership Uses

func (s *OrganizationsService) RemoveTeamMembership(ctx context.Context, team int, user string) (*Response, error)

RemoveTeamMembership removes a user from a team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#remove-team-membership

func (*OrganizationsService) RemoveTeamRepo Uses

func (s *OrganizationsService) RemoveTeamRepo(ctx context.Context, team int, owner string, repo string) (*Response, error)

RemoveTeamRepo removes a repository from being managed by the specified team. Note that this does not delete the repository, it just removes it from the team.

GitHub API docs: https://developer.github.com/v3/orgs/teams/#remove-team-repo

type Page Uses

type Page struct {
    PageName *string `json:"page_name,omitempty"`
    Title    *string `json:"title,omitempty"`
    Summary  *string `json:"summary,omitempty"`
    Action   *string `json:"action,omitempty"`
    SHA      *string `json:"sha,omitempty"`
    HTMLURL  *string `json:"html_url,omitempty"`
}

Page represents a single Wiki page.

func (*Page) GetAction Uses

func (p *Page) GetAction() string

GetAction returns the Action field if it's non-nil, zero value otherwise.

func (*Page) GetHTMLURL Uses

func (p *Page) GetHTMLURL() string

GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.

func (*Page) GetPageName Uses

func (p *Page) GetPageName() string

GetPageName returns the PageName field if it's non-nil, zero value otherwise.

func (*Page) GetSHA Uses

func (p *Page) GetSHA() string

GetSHA returns the SHA field if it's non-nil, zero value otherwise.

func (*Page) GetSummary Uses

func (p *Page) GetSummary() string

GetSummary returns the Summary field if it's non-nil, zero value otherwise.

func (*Page) GetTitle Uses

func (p *Page) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

type PageBuildEvent Uses

type PageBuildEvent struct {
    Build *PagesBuild `json:"build,omitempty"`

    // The following fields are only populated by Webhook events.
    ID           *int          `json:"id,omitempty"`
    Repo         *Repository   `json:"repository,omitempty"`
    Sender       *User         `json:"sender,omitempty"`
    Installation *Installation `json:"installation,omitempty"`
}

PageBuildEvent represents an attempted build of a GitHub Pages site, whether successful or not. The Webhook event name is "page_build".

This event is triggered on push to a GitHub Pages enabled branch (gh-pages for project pages, master for user and organization pages).

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/#pagebuildevent

func (*PageBuildEvent) GetID Uses

func (p *PageBuildEvent) GetID() int

GetID returns the ID field if it's non-nil, zero value otherwise.

type Pages Uses

type Pages struct {
    URL       *string `json:"url,omitempty"`
    Status    *string `json:"status,omitempty"`
    CNAME     *string `json:"cname,omitempty"`
    Custom404 *bool   `json:"custom_404,omitempty"`
    HTMLURL   *string `json:"html_url,omitempty"`
}

Pages represents a GitHub Pages site configuration.

func (*Pages) GetCNAME Uses

func (p *Pages) GetCNAME() string

GetCNAME returns the CNAME field if it's non-nil, zero value otherwise.

func (*Pages) GetCustom404 Uses

func (p *Pages) GetCustom404() bool

GetCustom404 r