github

package
v0.2.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 7 Imported by: ? modules, 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 Client

type Client interface {
	GetOrganizationName() string
	CreateRegistrationToken(context.Context, string) (string, error)
	ListRunners(context.Context, string) ([]*Runner, error)
	RemoveRunner(context.Context, string, int64) error
}

Client generates token for GitHub Action selfhosted runner

func NewClient

func NewClient(
	appID int64,
	appInstallationID int64,
	appPrivateKeyPath string,
	organizationName string,
) (Client, error)

NewClient creates GitHub Actions Client

type FakeClient

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

FakeClient is a fake client

func NewFakeClient

func NewFakeClient(organizationName string) *FakeClient

NewFakeClient creates GitHub Actions Client.

func (*FakeClient) CreateRegistrationToken

func (c *FakeClient) CreateRegistrationToken(ctx context.Context, repositoryName string) (string, error)

CreateRegistrationToken returns dummy token.

func (*FakeClient) GetOrganizationName

func (c *FakeClient) GetOrganizationName() string

GetOrganizationName returns organizationName.

func (*FakeClient) ListRunners

func (c *FakeClient) ListRunners(ctx context.Context, repositoryName string) ([]*Runner, error)

ListRunners returns dummy list.

func (*FakeClient) RemoveRunner

func (c *FakeClient) RemoveRunner(ctx context.Context, repositoryName string, runnerID int64) error

RemoveRunner does not delete anything and returns success.

func (*FakeClient) SetRunners

func (c *FakeClient) SetRunners(runners map[string][]*Runner)

SetRunners sets runners for multiple repositories

type Runner

type Runner struct {
	ID     int64
	Name   string
	Online bool
	Busy   bool
	Labels []string
}

Jump to

Keyboard shortcuts

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