Documentation
¶
Index ¶
- Variables
- func ErrorStatus(err error) (int, bool)
- func IsRateLimitError(err error) bool
- func LabelsMatch(jobLabels, required []string) bool
- func RateLimitRetryAfter(err error) (string, bool)
- func VerifyWebhookSignature(secret string, body []byte, signature string) bool
- type Account
- type AppAuth
- type Client
- func NewAppClient(baseURL string, auth AppAuth, httpClient *http.Client) (*Client, error)
- func NewBasicAuthClient(baseURL, username, password string, httpClient *http.Client) *Client
- func NewClient(baseURL string, httpClient *http.Client) *Client
- func NewTokenClient(baseURL, token string, httpClient *http.Client) *Client
- func (c *Client) CreateRegistrationToken(ctx context.Context, repositoryFullName, runnerGroup string) (RegistrationToken, error)
- func (c *Client) DownloadWorkflowJobLogs(ctx context.Context, repositoryFullName string, jobID int64) ([]byte, string, error)
- func (c *Client) DownloadWorkflowRunLogs(ctx context.Context, repositoryFullName string, runID int64) ([]byte, string, error)
- func (c *Client) GetAccount(ctx context.Context, login string) (Account, error)
- func (c *Client) GetInstallation(ctx context.Context, installationID int64) (Installation, error)
- func (c *Client) GetIssue(ctx context.Context, repositoryFullName string, number int64) (Issue, error)
- func (c *Client) GetPullRequest(ctx context.Context, repositoryFullName string, number int64) (PullRequest, error)
- func (c *Client) GetWorkflowJob(ctx context.Context, repositoryFullName string, jobID int64) (WorkflowJob, error)
- func (c *Client) ListInstallationRepositories(ctx context.Context, installationID int64) ([]string, error)
- func (c *Client) ListRunners(ctx context.Context, repositoryFullName, runnerGroup string) ([]Runner, error)
- func (c *Client) ListUserInstallationRepositories(ctx context.Context, token string, installationID int64) ([]string, error)
- func (c *Client) ListUserInstallations(ctx context.Context, token string) ([]Installation, error)
- func (c *Client) ListUserOrganizationMemberships(ctx context.Context, token string) ([]OrganizationMembership, error)
- func (c *Client) ListWorkflowRunJobs(ctx context.Context, repositoryFullName string, runID int64) ([]WorkflowJob, error)
- func (c *Client) RemoveRunner(ctx context.Context, repositoryFullName, runnerGroup string, runnerID int64) error
- func (c *Client) RemoveRunnerByName(ctx context.Context, repositoryFullName, runnerGroup, runnerName string) (bool, error)
- func (c *Client) RunnerURL(repositoryFullName, runnerGroup string) (string, error)
- type Installation
- type InstallationRef
- type Issue
- type Labels
- type OrganizationMembership
- type PullRequest
- type RegistrationToken
- type Repository
- type Runner
- type WorkflowJob
- type WorkflowJobEvent
- type WorkflowRun
- type WorkflowRunEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountNotFound = errors.New("github account not found") ErrUnsupportedAccountType = errors.New("unsupported github account type") )
Functions ¶
func ErrorStatus ¶
ErrorStatus returns the HTTP status carried by a GitHub API error.
func IsRateLimitError ¶
IsRateLimitError reports whether GitHub rejected the request because of a primary or secondary rate limit.
func LabelsMatch ¶
func RateLimitRetryAfter ¶
RateLimitRetryAfter returns GitHub's Retry-After header for a classified rate-limit response.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewAppClient ¶
func NewBasicAuthClient ¶
func (*Client) CreateRegistrationToken ¶
func (*Client) DownloadWorkflowJobLogs ¶
func (*Client) DownloadWorkflowRunLogs ¶
func (*Client) GetAccount ¶
func (*Client) GetInstallation ¶
func (*Client) GetPullRequest ¶
func (*Client) GetWorkflowJob ¶
func (*Client) ListInstallationRepositories ¶
func (*Client) ListRunners ¶
func (*Client) ListUserInstallationRepositories ¶
func (c *Client) ListUserInstallationRepositories(ctx context.Context, token string, installationID int64) ([]string, error)
ListUserInstallationRepositories lists repositories accessible to both the user token and installation.
func (*Client) ListUserInstallations ¶
func (*Client) ListUserOrganizationMemberships ¶
func (*Client) ListWorkflowRunJobs ¶
func (*Client) RemoveRunner ¶
func (*Client) RemoveRunnerByName ¶
type Installation ¶
type Installation struct {
ID int64 `json:"id"`
AccountID int64 `json:"account_id,omitempty"`
AccountType string `json:"account_type,omitempty"`
AccountLogin string `json:"account_login,omitempty"`
AccountName string `json:"account_name,omitempty"`
AccountAvatar string `json:"account_avatar,omitempty"`
Repositories []string `json:"repositories"`
}
type InstallationRef ¶
type InstallationRef struct {
ID int64 `json:"id"`
}
type OrganizationMembership ¶
type PullRequest ¶
type RegistrationToken ¶
type Repository ¶
type WorkflowJob ¶
type WorkflowJobEvent ¶
type WorkflowJobEvent struct {
Action string `json:"action"`
WorkflowJob WorkflowJob `json:"workflow_job"`
Repository Repository `json:"repository"`
WorkflowRun WorkflowRun `json:"workflow_run"`
Installation InstallationRef `json:"installation"`
}
type WorkflowRun ¶
type WorkflowRunEvent ¶
type WorkflowRunEvent struct {
Action string `json:"action"`
WorkflowRun WorkflowRun `json:"workflow_run"`
Repository Repository `json:"repository"`
Installation InstallationRef `json:"installation"`
}
Click to show internal directories.
Click to hide internal directories.