Documentation
¶
Index ¶
- Constants
- Variables
- type Assignment
- type Credential
- type FixedOperation
- type Heartbeat
- type Operation
- type Pool
- type PoolFilter
- type PoolInput
- type Runner
- type Service
- func (s *Service) AuthenticateSupervisor(ctx context.Context, raw string) (Runner, error)
- func (s *Service) Broker(ctx context.Context, raw, name, connection string, input json.RawMessage) (json.RawMessage, error)
- func (s *Service) BuiltinOrgs(ctx context.Context) ([]string, error)
- func (s *Service) CheckRunnerTx(ctx context.Context, tx pgx.Tx, org, id string) error
- func (s *Service) CheckScopeTx(ctx context.Context, tx pgx.Tx, org, kind, id string) error
- func (s *Service) Claim(ctx context.Context, raw string) (Assignment, error)
- func (s *Service) Complete(ctx context.Context, raw string, in workflow.Completion) (workflow.Task, error)
- func (s *Service) Download(ctx context.Context, session auth.Session, org, id string) (artifact.Metadata, io.ReadCloser, error)
- func (s *Service) DownloadJob(ctx context.Context, raw, id string) (artifact.Metadata, io.ReadCloser, error)
- func (s *Service) Enroll(ctx context.Context, raw, name string) (Credential, error)
- func (s *Service) EnrollBuiltin(ctx context.Context, org, name string, slots int) (Credential, error)
- func (s *Service) EnrollToken(ctx context.Context, session auth.Session, org, pool, request string) (Credential, error)
- func (s *Service) Heartbeat(ctx context.Context, raw string) (Heartbeat, error)
- func (s *Service) Metadata(ctx context.Context, session auth.Session, org, id string) (artifact.Metadata, error)
- func (s *Service) Pool(ctx context.Context, session auth.Session, org, id string) (Pool, error)
- func (s *Service) Pools(ctx context.Context, session auth.Session, org string, filter PoolFilter, ...) (domain.Page[Pool], error)
- func (s *Service) Progress(ctx context.Context, raw string, next domain.TaskState) (workflow.Task, error)
- func (s *Service) PutPool(ctx context.Context, session auth.Session, org, id string, in PoolInput, ...) (Pool, error)
- func (s *Service) RegisterOperation(name string, handler FixedOperation) error
- func (s *Service) Revoke(ctx context.Context, session auth.Session, org, id string, expected int64, ...) error
- func (s *Service) Rotate(ctx context.Context, raw string) (Credential, error)
- func (s *Service) Runners(ctx context.Context, session auth.Session, org, pool string, limit int, ...) (domain.Page[Runner], error)
- func (s *Service) Upload(ctx context.Context, raw, name, media string, input io.Reader) (artifact.Metadata, error)
- func (s *Service) ValidatePrivateSupervisorTx(ctx context.Context, tx pgx.Tx, expected Runner, credentialHash string) error
- func (s *Service) WithJob(ctx context.Context, raw, action string, ...) error
- func (s *Service) WithJobTx(ctx context.Context, tx pgx.Tx, raw, action string, ...) error
Constants ¶
View Source
const BuiltinTenantConcurrency = 4
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 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 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 (*Service) AuthenticateSupervisor ¶
func (*Service) Broker ¶
func (s *Service) Broker(ctx context.Context, raw, name, connection string, input json.RawMessage) (json.RawMessage, error)
func (*Service) CheckRunnerTx ¶
func (*Service) CheckScopeTx ¶
func (*Service) DownloadJob ¶
func (*Service) EnrollBuiltin ¶
func (*Service) EnrollToken ¶
func (*Service) RegisterOperation ¶
func (s *Service) RegisterOperation(name string, handler FixedOperation) error
func (*Service) ValidatePrivateSupervisorTx ¶
Click to show internal directories.
Click to hide internal directories.