runner

package
v0.0.0-...-58fbc17 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingParameter = errors.New("missing parameter")
	ErrInvalidParameter = errors.New("invalid parameter")
	ErrGHRequestFailed  = errors.New("github request failed")
)

Functions

This section is empty.

Types

type Command

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

Command is a simple wrapper for exec.CommandContext

func NewCommand

func NewCommand(path string, stdout, stderr io.Writer) (*Command, error)

func (*Command) Run

func (c *Command) Run(ctx context.Context, args ...string) error

type Config

type Config struct {
	Replace       bool           // config.sh --replace option. default true
	Once          bool           // run.sh --once option
	URL           string         // organization/repository registration url
	Path          string         // installation path of the runner.
	WorkDir       string         // working directory for the runner
	Name          string         // name of the runner
	Labels        []string       // additional runner labels
	TokenProvider *TokenProvider // token provider instance
}

Config represents runner configuration

type Runner

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

Runner represents self-hosted runner instance

func NewRunner

func NewRunner(config *Config) (*Runner, error)

NewRunner returns new Runner instance

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

type TokenProvider

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

TokenProvider is simple github.Client wrapper responsible for creating registration and remove tokens for runners

func NewTokenProvider

func NewTokenProvider(url string, client *github.Client) (*TokenProvider, error)

NewTokenProvider returns new TokenProvider instance

func (*TokenProvider) CreateRegistrationToken

func (tp *TokenProvider) CreateRegistrationToken() (*github.RegistrationToken, error)

CreateRegistrationToken returns new runner registration token

func (*TokenProvider) CreateRemoveToken

func (tp *TokenProvider) CreateRemoveToken() (*github.RemoveToken, error)

CreateRemoveToken returns new runner remove token

Jump to

Keyboard shortcuts

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