github

package
v0.0.0-...-3a0f996 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PersonalAccessToken

func PersonalAccessToken(ctx context.Context, token string) *http.Client

PersonalAccessToken creates a new Oauth2 http client utilizing the personal access token

func RestRequest

func RestRequest(method string, format string, args ...interface{}) (*http.Request, error)

RestRequest creates a http.Request for the given method and format string to build the url

Types

type ActionsService

type ActionsService struct {
	*github.ActionsService
	// contains filtered or unexported fields
}

ActionsService exposes the github actions apis in the Client

func (*ActionsService) CreateRunnersRegistrationToken

func (s *ActionsService) CreateRunnersRegistrationToken(ctx context.Context, owner, repo string) (*ActionsToken, *github.Response, error)

CreateRunnersRegistrationToken Returns a token that you can pass to the config script. The token expires after one hour. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

func (*ActionsService) CreateRunnersRemoveToken

func (s *ActionsService) CreateRunnersRemoveToken(ctx context.Context, owner, repo string) (*ActionsToken, *github.Response, error)

CreateRunnersRemoveToken Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

func (*ActionsService) CreateRunnersTokenRequest

func (s *ActionsService) CreateRunnersTokenRequest(ctx context.Context, owner, repo, tokenType string) (*ActionsToken, *github.Response, error)

CreateRunnersTokenRequest Returns a create/remove token which can be used for the config script or remove script. The token expires after one hour. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

func (*ActionsService) DeleteRunners

func (s *ActionsService) DeleteRunners(ctx context.Context, owner, repo string, runnerID int64) (*github.Response, error)

DeleteRunners Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

func (*ActionsService) ListRunners

func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string) ([]*Runner, *github.Response, error)

ListRunners Lists all self-hosted runners for a repository. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

func (*ActionsService) ListRunnersDownloads

func (s *ActionsService) ListRunnersDownloads(ctx context.Context, owner, repo string) ([]*RunnerDownload, *github.Response, error)

ListRunnersDownloads Lists binaries for the self-hosted runner application that you can download and run. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the administration permission to use this endpoint.

type ActionsToken

type ActionsToken struct {
	Token     *string           `json:"token,omitempty"`
	ExpiresAt *github.Timestamp `json:"expires_at,omitempty"`
}

ActionsToken represents a create/remove token for a Github actions runner

type Client

type Client struct {
	*github.Client
	Actions *ActionsService
}

Client decorates the github.Client with newly added github actions API calls.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient creates an instance of the decorated github.Client with newly added github actions API calls.

type Runner

type Runner struct {
	ID     *int64  `json:"id,omitempty"`
	Name   *string `json:"name,omitempty"`
	OS     *string `json:"os,omitempty"`
	Status *string `json:"status,omitempty"`
}

Runner represents a self hosted runner object

type RunnerDownload

type RunnerDownload struct {
	OS           *string `json:"os,omitempty"`
	Architecture *string `json:"architecture,omitempty"`
	DownloadURL  *string `json:"download_url,omitempty"`
	Filename     *string `json:"filename,omitempty"`
}

RunnerDownload represents a self hosted runner download object

Jump to

Keyboard shortcuts

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