Documentation
¶
Overview ¶
Package agent connects the runner to Backproof.
Index ¶
Constants ¶
const ( ExitPassed = 0 ExitBackupFailed = 1 ExitRunnerError = 2 )
Exit codes of a one-shot run, which CI systems act on.
Variables ¶
This section is empty.
Functions ¶
func DefaultCapabilities ¶
func DefaultCapabilities() api.Capabilities
DefaultCapabilities lists what this build of the runner can do.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent polls Backproof for due jobs and runs them.
type JobContext ¶
JobContext connects a running job to the agent.
type JobRunnerOptions ¶
type JobRunnerOptions struct {
Engine job.Engine
Logger *slog.Logger
WorkDir string
DiskMargin float64
Lookup config.LookupFunc
SourcesFile string
// RunnerKey opens the keys sealed for this runner in the dashboard.
RunnerKey config.Secret
}
JobRunnerOptions configures how claimed jobs are run.
type OnceSummary ¶
OnceSummary counts the outcomes of a one-shot run.
func (OnceSummary) ExitCode ¶
func (s OnceSummary) ExitCode(runErr error) int
ExitCode reports a broken backup first, because that is the finding someone has to act on.
type Options ¶
type Options struct {
Client *api.RunnerClient
Run Runner
Logger *slog.Logger
Concurrency int
Version string
Capabilities api.Capabilities
}
Options configures an Agent.
type RegisterOptions ¶
type RegisterOptions struct {
InstallToken config.Secret
Name string
APIURL string
FilePath string
}
RegisterOptions configures a registration.
type Registration ¶
Registration describes a newly registered runner.
func Register ¶
func Register(ctx context.Context, client *api.RunnerClient, options RegisterOptions) (Registration, error)
Register trades an install token for a runner credential and saves it with a new key pair.
type Runner ¶
Runner tests the backup of one claimed job.
func NewJobRunner ¶
func NewJobRunner(options JobRunnerOptions) Runner
NewJobRunner returns the Runner that tests a claimed job's latest backup.