Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrRateLimit = errors.New("rate limit hit") ErrAssetNotFound = errors.New("asset not found") ErrUnableToDownloadAsset = errors.New("unable to download asset") ErrUnableToReadAsset = errors.New("unable to download asset") ErrFatalError = errors.New("fatal error using github") )
var ErrFieldUnexpectedlyNil = errors.New("expected field to be non-nil")
ErrFieldUnexpectedlyNil is returned when a field that is expected to be non-nil is found to be nil. A lot of GitHub API fields are pointers, so we need to check for nil values.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(token string, opts ...ClientOption) *Client
NewClient creates a new Github Client. If the token is not empty, it will use it as the auth token to make calls.
type ClientOption ¶
func WithBaseURL ¶
func WithBaseURL(baseURL *url.URL) ClientOption
type GitHubUser ¶
type ReleaseFile ¶
type ReleaseFile struct {
Contents io.ReadCloser
Info ReleaseInfo
}
ReleaseFile represents a file in a given Github release.
type ReleaseInfo ¶
type ReleaseInfo struct {
// If the tag is valid, the will be non null.
Tag *string
}
type RepoClient ¶
type UserGitHubClient ¶
type UserGitHubClient struct {
// contains filtered or unexported fields
}
UserGitHubClient is a client that receives a token from a user that has installed our GitHub App. It uses that token to make requests on behalf of that user to verify things about them. It is different from the regular Client which is used for internal operations.
func NewUserGitHubClient ¶
func NewUserGitHubClient(token string, opts ...ClientOption) *UserGitHubClient
NewUserGitHubClient creates a new UserGitHubClient with the given token. Assumes that the token is not empty.
func (*UserGitHubClient) GetCurrentUser ¶
func (c *UserGitHubClient) GetCurrentUser(ctx context.Context) (*GitHubUser, error)
func (*UserGitHubClient) ListEmails ¶
func (c *UserGitHubClient) ListEmails(ctx context.Context) ([]*UserEmail, error)