github

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrganizationRegistrationToken added in v0.5.0

func CreateOrganizationRegistrationToken(ctx context.Context, client *Client, owner string) (*github.RegistrationToken, *github.Response, error)

CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner on an organization.

GitHub API docs: https://developer.github.com/v3/actions/self-hosted-runners/#create-a-registration-token-for-an-organization

func ListOrganizationRunners added in v0.5.0

func ListOrganizationRunners(ctx context.Context, client *Client, owner string, opts *github.ListOptions) (*github.Runners, *github.Response, error)

ListOrganizationRunners lists all the self-hosted runners for an organization.

GitHub API docs: https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization

func RemoveOrganizationRunner added in v0.5.0

func RemoveOrganizationRunner(ctx context.Context, client *Client, owner string, runnerID int64) (*github.Response, error)

RemoveOrganizationRunner forces the removal of a self-hosted runner in a repository using the runner id.

GitHub API docs: https://developer.github.com/v3/actions/self_hosted_runners/#remove-a-self-hosted-runner

Types

type Client

type Client struct {
	*github.Client

	// GithubBaseURL to Github without API suffix.
	GithubBaseURL string
	// contains filtered or unexported fields
}

Client wraps GitHub client with some additional

func (*Client) GetRegistrationToken

func (c *Client) GetRegistrationToken(ctx context.Context, org, repo, name string) (*github.RegistrationToken, error)

GetRegistrationToken returns a registration token tied with the name of repository and runner.

func (*Client) ListRunners

func (c *Client) ListRunners(ctx context.Context, org, repo string) ([]*github.Runner, error)

ListRunners returns a list of runners of specified owner/repository name.

func (*Client) RemoveRunner

func (c *Client) RemoveRunner(ctx context.Context, org, repo string, runnerID int64) error

RemoveRunner removes a runner with specified runner ID from repository.

type Config added in v0.10.0

type Config struct {
	EnterpriseURL     string `split_words:"true"`
	AppID             int64  `split_words:"true"`
	AppInstallationID int64  `split_words:"true"`
	AppPrivateKey     string `split_words:"true"`
	Token             string
}

Config contains configuration for Github client

func (*Config) NewClient added in v0.10.0

func (c *Config) NewClient() (*Client, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL