lifecycle

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event string
const (
	EventWarmReady            Event = "warm-ready"
	EventAdmit                Event = "admit"
	EventBeginRegistration    Event = "begin-registration"
	EventRunnerOnline         Event = "runner-online"
	EventAssigned             Event = "assigned"
	EventJobStarted           Event = "job-started"
	EventJobSucceeded         Event = "job-succeeded"
	EventJobFailed            Event = "job-failed"
	EventJobCancelled         Event = "job-cancelled"
	EventProvisionFailed      Event = "provision-failed"
	EventRegistrationFailed   Event = "registration-failed"
	EventAssignmentTimedOut   Event = "assignment-timed-out"
	EventDrain                Event = "drain"
	EventDiagnosticsCollected Event = "diagnostics-collected"
	EventDiagnosticsFailed    Event = "diagnostics-failed"
	EventDestroyed            Event = "destroyed"
	EventDestroyFailed        Event = "destroy-failed"
	EventRetryDestroy         Event = "retry-destroy"
)

type Outcome

type Outcome string
const (
	OutcomeNone                  Outcome = ""
	OutcomeSucceeded             Outcome = "succeeded"
	OutcomeFailed                Outcome = "failed"
	OutcomeCancelled             Outcome = "cancelled"
	OutcomeInfrastructureFailure Outcome = "infrastructure-failure"
)

type State

type State string
const (
	StateProvisioning  State = "provisioning"
	StateAvailableWarm State = "available-warm"
	StateAdmitted      State = "admitted"
	StateRegistering   State = "registering"
	StateOnline        State = "online"
	StateAssigned      State = "assigned"
	StateRunning       State = "running"
	StateCollecting    State = "collecting"
	StateDestroying    State = "destroying"
	StateDestroyed     State = "destroyed"
	StateQuarantined   State = "quarantined"
)

type Worker

type Worker struct {
	ID          string        `json:"id"`
	ImageDigest string        `json:"image_digest"`
	State       State         `json:"state"`
	JobKey      domain.JobKey `json:"job_key,omitempty"`
	HasRun      bool          `json:"has_run"`
	Outcome     Outcome       `json:"outcome,omitempty"`
}

func NewWorker

func NewWorker(id, imageDigest string) (Worker, error)

func (Worker) Transition

func (worker Worker) Transition(event Event, jobKey domain.JobKey) (Worker, error)

Transition returns a new aggregate and leaves the receiver unchanged. The caller persists the returned aggregate and event atomically in the journal.

Jump to

Keyboard shortcuts

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