runner

package
v0.31.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 20 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

View Source
const (
	JobResultSuccess   = "success"
	JobResultFailure   = "failure"
	JobResultCancelled = "cancelled"
	JobResultUnknown   = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.4.0

type Client interface {
	PutDeletionTime(ctx context.Context, ip string, tm time.Time) error
	GetStatus(ctx context.Context, ip string) (*Status, error)
}

func NewClient added in v0.4.0

func NewClient() Client

type DeletionTimePayload added in v0.4.0

type DeletionTimePayload struct {
	DeletionTime time.Time `json:"deletion_time"`
}

type FakeClient added in v0.4.0

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

FakeClient is a fake client

func NewFakeClient added in v0.4.0

func NewFakeClient() *FakeClient

func (*FakeClient) GetStatus added in v0.4.0

func (c *FakeClient) GetStatus(ctx context.Context, ip string) (*Status, error)

func (*FakeClient) PutDeletionTime added in v0.4.0

func (c *FakeClient) PutDeletionTime(ctx context.Context, ip string, tm time.Time) error

func (*FakeClient) SetStatus added in v0.4.0

func (c *FakeClient) SetStatus(ip string, st *Status)

type JobInfo added in v0.4.0

type JobInfo struct {
	Actor          string `json:"actor,omitempty"`
	GitRef         string `json:"git_ref,omitempty"`
	JobID          string `json:"job_id,omitempty"`
	PullRequestNum int    `json:"pull_request_number,omitempty"`
	Repository     string `json:"repository,omitempty"`
	RunID          int    `json:"run_id,omitempty"`
	RunNumber      int    `json:"run_number,omitempty"`
	WorkflowName   string `json:"workflow_name,omitempty"`
	// StartedAt is the time when `job-started` was called.
	StartedAt *time.Time `json:"started_at,omitempty"`
}

JobInfo represents information about a CI job.

func GetJobInfo added in v0.4.0

func GetJobInfo() (*JobInfo, error)

GetJobInfo reads environment variables and creates JobInfo. StartedAt is set to the current time.

func GetJobInfoFromFile added in v0.4.0

func GetJobInfoFromFile(file string) (*JobInfo, error)

func (*JobInfo) BranchTagURL added in v0.4.0

func (info *JobInfo) BranchTagURL() string

func (*JobInfo) MetricsLabels added in v0.30.0

func (info *JobInfo) MetricsLabels() *metrics.JobInfoLabels

MetricsLabels returns the label values of meows_runner_job_info.

func (*JobInfo) PullRequestURL added in v0.4.0

func (info *JobInfo) PullRequestURL() string

func (*JobInfo) RepositoryURL added in v0.4.0

func (info *JobInfo) RepositoryURL() string

func (*JobInfo) WorkflowURL added in v0.4.0

func (info *JobInfo) WorkflowURL() string

type Listener

type Listener interface {
	// contains filtered or unexported methods
}

func NewListener

func NewListener(runnerDir string) Listener

type Option

type Option struct {
	SetupCommand []string `json:"setup_command,omitempty"`
}

Omittable options

type Runner

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

func NewRunner

func NewRunner(listener Listener, listenAddr, runnerDir, workDir, varDir string) (*Runner, error)

func (*Runner) Run

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

type Status added in v0.4.0

type Status struct {
	State        string     `json:"state,omitempty"`
	Result       string     `json:"result,omitempty"`
	FinishedAt   *time.Time `json:"finished_at,omitempty"`
	DeletionTime *time.Time `json:"deletion_time,omitempty"`
	Extend       *bool      `json:"extend,omitempty"`
	JobInfo      *JobInfo   `json:"job_info,omitempty"`
	SlackChannel string     `json:"slack_channel,omitempty"`
}

Jump to

Keyboard shortcuts

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