github

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Username string
	Password string
}

func (BasicAuthTransport) RoundTrip

func (p BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Client

type Client struct {
	*github.Client

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

Client wraps GitHub client with some additional

func (*Client) GetRegistrationToken

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

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

func (*Client) IsRunnerBusy

func (r *Client) IsRunnerBusy(ctx context.Context, enterprise, org, repo, name string) (bool, error)

func (*Client) ListOrganizationRunnerGroupsForRepository

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

ListOrganizationRunnerGroupsForRepository returns all the runner groups defined in the organization and inherited to the organization from an enterprise. We can remove this when google/go-github library is updated to support this.

func (*Client) ListRepositoryWorkflowRuns

func (c *Client) ListRepositoryWorkflowRuns(ctx context.Context, user string, repoName string) ([]*github.WorkflowRun, error)

func (*Client) ListRunnerGroupRepositoryAccesses

func (c *Client) ListRunnerGroupRepositoryAccesses(ctx context.Context, org string, runnerGroupId int64) ([]*github.Repository, error)

func (*Client) ListRunners

func (c *Client) ListRunners(ctx context.Context, enterprise, 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, enterprise, org, repo string, runnerID int64) error

RemoveRunner removes a runner with specified runner ID from repository.

type Config

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
	URL               string `split_words:"true"`
	UploadURL         string `split_words:"true"`
	BasicauthUsername string `split_words:"true"`
	BasicauthPassword string `split_words:"true"`
	RunnerGitHubURL   string `split_words:"true"`

	Log *logr.Logger
}

Config contains configuration for Github client

func (*Config) NewClient

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

NewClient creates a Github Client

type RunnerNotFound

type RunnerNotFound struct {
	// contains filtered or unexported fields
}

func (*RunnerNotFound) Error

func (e *RunnerNotFound) Error() string

type RunnerOffline

type RunnerOffline struct {
	// contains filtered or unexported fields
}

func (*RunnerOffline) Error

func (e *RunnerOffline) Error() string

Directories

Path Synopsis
Package metrics provides monitoring of the GitHub related metrics.
Package metrics provides monitoring of the GitHub related metrics.

Jump to

Keyboard shortcuts

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