Documentation ¶
Overview ¶
Package github provides an implementation of the provider.Client interface for the GitHub REST API.
Index ¶
- Variables
- type Client
- func (g *Client) Groups(tok string) ([]int64, error)
- func (g *Client) Repos(tok string, page int64) ([]*provider.Repo, database.Paginator, error)
- func (g *Client) SetCommitStatus(tok string, r *provider.Repo, status runner.Status, url, sha string) error
- func (g *Client) ToggleRepo(tok string, r *provider.Repo) error
- func (g *Client) VerifyRequest(r io.Reader, signature string) ([]byte, error)
- type Error
- type PullRequestEvent
- type PushEvent
- type Repo
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
PullRequestActions = map[string]struct{}{
"opened": {},
"reopened": {},
"unlocked": {},
"synchronize": {},
}
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
provider.BaseClient
}
func New ¶
New returns a new Client to the GitHub REST API. If the given endpoint is empty then the default "https://api.github.com" will be used. This will set the following scopes to request: "admin:repo_hook", "read:org", "repo".
func (*Client) Groups ¶
Groups implements the provider.Client interface. For GitHub this will return a slice of the organization IDs the user is either an owner of, or a member of.
func (*Client) SetCommitStatus ¶
func (g *Client) SetCommitStatus(tok string, r *provider.Repo, status runner.Status, url, sha string) error
SetCommitStatus implements the provider.Client interface.
func (*Client) ToggleRepo ¶
ToggleRepo implementas the provider.Client interface.
type Error ¶
type Error struct { Message string // Message is the original message from a failed request. Errors []map[string]string // Errors is the list of errors that occurred from a failed request. }
type PullRequestEvent ¶
Click to show internal directories.
Click to hide internal directories.