Help us shape the future of Go! Take the 2026 Go Developer Survey

runner

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("runner operation is not registered")

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	Credential Credential     `json:"-"`
	Lease      workflow.Lease `json:"lease"`
	Task       workflow.Task  `json:"task"`
}

func (Assignment) GoString

func (a Assignment) GoString() string

func (Assignment) String

func (a Assignment) String() string

type Credential

type Credential struct {
	Token     string    `json:"-"`
	ExpiresAt time.Time `json:"expires_at"`
	Runner    Runner    `json:"runner"`
}

func (Credential) GoString

func (c Credential) GoString() string

func (Credential) LogValue

func (c Credential) LogValue() slog.Value

func (Credential) String

func (c Credential) String() string

type FixedOperation

type FixedOperation func(context.Context, pgx.Tx, Operation) (json.RawMessage, error)

type Heartbeat

type Heartbeat struct {
	Lease  workflow.Lease `json:"lease"`
	Stop   bool           `json:"stop"`
	Reason string         `json:"reason,omitempty"`
}

type Operation

type Operation struct {
	Lease        workflow.Lease
	Task         workflow.Task
	RunnerID     string
	PoolID       string
	ConnectionID string
	Input        json.RawMessage
}

type Pool

type Pool struct {
	ID            string   `json:"id"`
	OrgID         string   `json:"org_id"`
	Name          string   `json:"name"`
	State         string   `json:"state"`
	RepositoryIDs []string `json:"repository_ids"`
	Version       int64    `json:"version"`
	RunnerCount   int      `json:"runner_count"`
	BusySlots     int      `json:"busy_slots"`
	Builtin       bool     `json:"builtin"`
}

type PoolFilter

type PoolFilter struct {
	Query string
	State string
}

type PoolInput

type PoolInput struct {
	Name          string   `json:"name"`
	State         string   `json:"state"`
	RepositoryIDs []string `json:"repository_ids"`
}

type Runner

type Runner struct {
	ID                  string    `json:"id"`
	OrgID               string    `json:"org_id"`
	PoolID              string    `json:"pool_id"`
	Name                string    `json:"name"`
	State               string    `json:"state"`
	Version             int64     `json:"version"`
	CredentialExpiresAt time.Time `json:"credential_expires_at"`
	PoolName            string    `json:"pool_name"`
	PoolState           string    `json:"pool_state"`
	LastSeenAt          time.Time `json:"last_seen_at"`
	EnrolledAt          time.Time `json:"enrolled_at"`
	BusySlots           int       `json:"busy_slots"`
	RouteCount          int       `json:"route_count"`
}

type Service

type Service struct {
	CompletionCheck func(context.Context, pgx.Tx, workflow.Lease, workflow.Task, workflow.Completion) error
	// contains filtered or unexported fields
}

func New

func New(db *store.Store, identity *auth.Service, jobs *workflow.Service, artifacts *artifact.Local) *Service

func (*Service) AuthenticateSupervisor

func (s *Service) AuthenticateSupervisor(ctx context.Context, raw string) (Runner, error)

func (*Service) Broker

func (s *Service) Broker(ctx context.Context, raw, name, connection string, input json.RawMessage) (json.RawMessage, error)

func (*Service) BuiltinOrgs

func (s *Service) BuiltinOrgs(ctx context.Context) ([]string, error)

func (*Service) CheckRunnerTx

func (s *Service) CheckRunnerTx(ctx context.Context, tx pgx.Tx, org, id string) error

func (*Service) CheckScopeTx

func (s *Service) CheckScopeTx(ctx context.Context, tx pgx.Tx, org, kind, id string) error

func (*Service) Claim

func (s *Service) Claim(ctx context.Context, raw string) (Assignment, error)

func (*Service) Complete

func (s *Service) Complete(ctx context.Context, raw string, in workflow.Completion) (workflow.Task, error)

func (*Service) Download

func (s *Service) Download(ctx context.Context, session auth.Session, org, id string) (artifact.Metadata, io.ReadCloser, error)

func (*Service) DownloadJob

func (s *Service) DownloadJob(ctx context.Context, raw, id string) (artifact.Metadata, io.ReadCloser, error)

func (*Service) Enroll

func (s *Service) Enroll(ctx context.Context, raw, name string) (Credential, error)

func (*Service) EnrollBuiltin

func (s *Service) EnrollBuiltin(ctx context.Context, org, name string, slots int) (Credential, error)

func (*Service) EnrollToken

func (s *Service) EnrollToken(ctx context.Context, session auth.Session, org, pool, request string) (Credential, error)

func (*Service) Heartbeat

func (s *Service) Heartbeat(ctx context.Context, raw string) (Heartbeat, error)

func (*Service) Metadata

func (s *Service) Metadata(ctx context.Context, session auth.Session, org, id string) (artifact.Metadata, error)

func (*Service) Pool

func (s *Service) Pool(ctx context.Context, session auth.Session, org, id string) (Pool, error)

func (*Service) Pools

func (s *Service) Pools(ctx context.Context, session auth.Session, org string, filter PoolFilter, limit int, cursor string) (domain.Page[Pool], error)

func (*Service) Progress

func (s *Service) Progress(ctx context.Context, raw string, next domain.TaskState) (workflow.Task, error)

func (*Service) PutPool

func (s *Service) PutPool(ctx context.Context, session auth.Session, org, id string, in PoolInput, expected int64, request string) (Pool, error)

func (*Service) RegisterOperation

func (s *Service) RegisterOperation(name string, handler FixedOperation) error

func (*Service) Revoke

func (s *Service) Revoke(ctx context.Context, session auth.Session, org, id string, expected int64, request string) error

func (*Service) Rotate

func (s *Service) Rotate(ctx context.Context, raw string) (Credential, error)

func (*Service) Runners

func (s *Service) Runners(ctx context.Context, session auth.Session, org, pool string, limit int, cursor string) (domain.Page[Runner], error)

func (*Service) Upload

func (s *Service) Upload(ctx context.Context, raw, name, media string, input io.Reader) (artifact.Metadata, error)

func (*Service) ValidatePrivateSupervisorTx

func (s *Service) ValidatePrivateSupervisorTx(ctx context.Context, tx pgx.Tx, expected Runner, credentialHash string) error

func (*Service) WithJob

func (s *Service) WithJob(ctx context.Context, raw, action string, fn func(pgx.Tx, workflow.Lease, workflow.Task) error) error

func (*Service) WithJobTx

func (s *Service) WithJobTx(ctx context.Context, tx pgx.Tx, raw, action string, fn func(pgx.Tx, workflow.Lease, workflow.Task) error) error

Jump to

Keyboard shortcuts

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