Documentation
¶
Overview ¶
Package model holds go/dispatch's value types: the job vocabulary, states and causes, holds, recovery policy and plans, actors, capabilities, and the adapter SPI's value types.
It imports nothing from dispatch, so dispatch/records can store these types without a cycle (spec 0001 D1). The root package re-exports them as aliases, so consumers import one package. Every enum encodes as text and refuses a name it does not know.
Index ¶
- Constants
- Variables
- func DecodeRecord(b []byte, v any) error
- func DecodeStrict(b []byte, v any) error
- func Epoch(generation, submission, restart int) (uint64, error)
- func Invalidf(format string, args ...any) error
- func RegisterExtension(proto Extension) error
- func SameObject(held, observed ObjectRef, restarted bool) bool
- type AbandonTarget
- type Action
- type Actor
- type ActorKind
- type Budgets
- type CallMeta
- type Capability
- type Cause
- type CauseKind
- type CessationEvidence
- type CheckpointMode
- type CleanupState
- type Completeness
- type Declarations
- type Discovery
- type Enforcer
- type Evidence
- type ExecutionObs
- type Extension
- type Extensions
- type Hold
- type HoldKind
- type HoldMeta
- type Image
- type JobID
- type JobSpec
- type Level
- type NativeOffer
- type ObjectObs
- type ObjectRef
- type ObjectState
- type Output
- type Plan
- type Progress
- type Provenance
- type RecoveryPolicy
- type Rule
- type RuleAssignment
- type RuleSupport
- type SharedCheckpoint
- type Source
- type StartRequest
- type State
- type StopReport
- type Support
- type Tristate
- type UnmatchedPolicy
- type ValidationError
Constants ¶
const EpochBound = 1_000_000
EpochBound is the exclusive bound on N and R in DISPATCH_EPOCH (spec 0003 D8).
const HoldBase = 315_576_000 * time.Second
HoldBase is the offset of a Slurm hold's far-future start time: ten Julian years (spec 0003 D9).
const Namespace = "dispatch"
Namespace is dispatch's own extension namespace.
const ReservedEnvPrefix = "DISPATCH_"
ReservedEnvPrefix is the environment namespace dispatch sets itself (spec 0003 D8).
const Unbounded time.Duration = -1
Unbounded is the PolledLoss window of evidence that stays readable however late it is polled, such as a Slurm requeue's end state where AccountingHistory is Yes (spec 0003 D7). It is a sentinel, never a length: compare windows only through Declarations' methods.
Variables ¶
var ( ErrNotFound = errors.New("dispatch: not found") ErrUnsupported = errors.New("dispatch: unsupported") ErrInvalid = errors.New("dispatch: invalid") ErrRejected = errors.New("dispatch: rejected") ErrUnreachable = errors.New("dispatch: unreachable") ErrReadOnly = errors.New("dispatch: read-only") ErrOutcomeUnknown = errors.New("dispatch: outcome unknown") )
The core's sentinels (spec 0001 D12). The root package re-exports them; a sentinel classifies and is added to the error chain, so the cause beneath it survives.
var ErrAlreadyRegistered = errors.New("dispatch: already registered")
ErrAlreadyRegistered is returned when an extension type is registered twice.
Functions ¶
func DecodeRecord ¶ added in v0.3.0
DecodeRecord is DecodeStrict for a record body, except that a well-formed cause-kind name this build does not know decodes as unrecognised, its name kept by the enclosing Cause, Rule or Plan (spec 0002 D4, amended 2026-11-02).
func DecodeStrict ¶
DecodeStrict decodes one JSON value into v, refusing unknown members, a member name that matches a field only when case is folded, a duplicate member, and anything after the value. encoding/json accepts all four, and each drops or overrides something silently. Durations and byte arrays are read as encoding/json writes them, since that is what encodes the records.
func Epoch ¶
Epoch is DISPATCH_EPOCH = G×10^12 + N×10^6 + R, which only increases across one job's executions and across its Supersedes lineage (spec 0003 D8, 0001 D16).
func RegisterExtension ¶
RegisterExtension lets the record decode an extension type. proto is a value of that type (not a pointer); adapters register their own extensions, and dispatch registers its built-ins.
func SameObject ¶
SameObject reports whether observed names the object held, whose Submit is the anchor first recorded: backend, id and UID equal, and a submit time equal to the anchor or, once restarted, at or after it, since a Slurm requeue moves it forward. The UID alone does not rule out a reused id, because a Slurm job's name is shared by every submission of it (spec 0003 D1).
Types ¶
type AbandonTarget ¶
type AbandonTarget struct {
Submission int `json:"submission,omitempty"`
Attempt int `json:"attempt,omitempty"`
Foreign ObjectRef `json:"foreign,omitzero"`
}
AbandonTarget names what Abandon ends: submission N, one attempt of N (0 meaning every unmatched attempt), or a foreign object alone (spec 0001 D6).
func (AbandonTarget) Validate ¶
func (t AbandonTarget) Validate() error
Validate refuses a target that names neither a submission nor a foreign object, or both.
type Action ¶
type Action int
Action is what a recovery rule does (spec 0001 D8).
const ( ActionUnset Action = iota ActionResubmit ActionRestart ActionRequeue ActionHold ActionEscalate )
The values of Action.
func (Action) MarshalText ¶
MarshalText encodes the value by name.
func (*Action) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type ActorKind ¶
type ActorKind int
ActorKind is what kind of party acted (spec 0001 D6).
The values of ActorKind.
func (ActorKind) MarshalText ¶
MarshalText encodes the value by name.
func (*ActorKind) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type Budgets ¶
Budgets is the logical budget left per rule, by the rule's index in the policy (spec 0003 D3).
type CallMeta ¶
CallMeta carries a hold-family or requeue call's deadline, checked on the scheduler's host when the command starts (spec 0003 D9).
type Capability ¶
type Capability string
Capability is a field, extension or behaviour whose support varies per cluster (spec 0001 D7).
const ( ContainerImage Capability = "ContainerImage" NativeRequeue Capability = "NativeRequeue" NativeRestart Capability = "NativeRestart" HoldCapability Capability = "Hold" PreTerminationSignal Capability = "PreTerminationSignal" AccountingHistory Capability = "AccountingHistory" AttemptInjection Capability = "AttemptInjection" ReadmissionGate Capability = "ReadmissionGate" WorkingDirectory Capability = "WorkingDirectory" ProcsPerNode Capability = "ProcsPerNode" OutputPath Capability = "OutputPath" OutputRead Capability = "OutputRead" OutputFollow Capability = "OutputFollow" OutputRetained Capability = "OutputRetained" )
The capabilities of spec 0001 D7 and D15.
func Capabilities ¶
func Capabilities() []Capability
Capabilities lists every capability, in spec order.
func (Capability) Known ¶
func (c Capability) Known() bool
Known reports whether c is one of Capabilities.
func (Capability) VisibleOnFailure ¶
func (c Capability) VisibleOnFailure() bool
VisibleOnFailure reports whether an unsupported request surfaces as an error to the caller rather than a job that runs differently. Only such a capability may proceed on Unknown (spec 0001 D7).
type Cause ¶
type Cause struct {
Kind CauseKind `json:"kind"`
Provenance Provenance `json:"provenance"`
Actor Actor `json:"actor,omitzero"`
Detail string `json:"detail,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
At time.Time `json:"at,omitzero"`
// contains filtered or unexported fields
}
Cause is why a state was reached. Detail keeps the backend's own words, verbatim, and a cause is never folded into Failed (spec 0001 D4).
func (Cause) KindName ¶ added in v0.3.0
KindName is the cause's kind by name: the name a newer build wrote, for an unrecognised kind.
func (Cause) MarshalJSON ¶ added in v0.3.0
MarshalJSON encodes the cause, writing an unrecognised kind's kept name back.
type CauseKind ¶
type CauseKind int
CauseKind is why a state was reached (spec 0001 D4); closed, with Unknown.
const ( CauseNone CauseKind = iota CausePreempted CauseNodeLost CauseOutOfMemory CauseTimeLimit CauseNonZeroExit CauseLaunchFailed CauseNoCapacity CauseHeld CauseReleased CauseRequeued CauseCancelled CauseDuplicate CauseUnknown )
The values of CauseKind.
func (CauseKind) MarshalText ¶
MarshalText encodes the value by name.
func (CauseKind) String ¶
String returns the value's name. An unrecognised kind's name is kept by the struct holding it.
func (*CauseKind) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
func (CauseKind) Unrecognised ¶ added in v0.3.0
Unrecognised reports whether v is a kind a newer build named, read from a record. The struct holding it keeps the name; it equals no kind and matches no rule.
type CessationEvidence ¶
type CessationEvidence struct {
Ceased bool `json:"ceased"`
Detail string `json:"detail,omitempty"`
At time.Time `json:"at"`
}
CessationEvidence is a cessation signal's answer on whether an object's processes are gone. Detail is each source's answer, a site command's output verbatim among them (spec 0003 D12).
type CheckpointMode ¶
type CheckpointMode int
CheckpointMode is whether executions isolate their checkpoints (spec 0001 D16).
const ( CheckpointIsolated CheckpointMode = iota )
The values of CheckpointMode.
func (CheckpointMode) MarshalText ¶
func (v CheckpointMode) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (CheckpointMode) String ¶
func (v CheckpointMode) String() string
String returns the value's name.
func (*CheckpointMode) UnmarshalText ¶
func (v *CheckpointMode) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (CheckpointMode) Valid ¶
func (v CheckpointMode) Valid() bool
Valid reports whether the value is named.
type CleanupState ¶
type CleanupState int
CleanupState is whether backend clean-up is outstanding (spec 0001 D4).
const ( CleanupClear CleanupState = iota CleanupPending CleanupBlocked )
The values of CleanupState.
func (CleanupState) MarshalText ¶
func (v CleanupState) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (*CleanupState) UnmarshalText ¶
func (v *CleanupState) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (CleanupState) Valid ¶
func (v CleanupState) Valid() bool
Valid reports whether the value is named.
type Completeness ¶
type Completeness int
Completeness is how complete a Find is (spec 0003 D6).
const (
Live Completeness = iota
)
The values of Completeness.
func (Completeness) MarshalText ¶
func (v Completeness) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (*Completeness) UnmarshalText ¶
func (v *Completeness) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (Completeness) Valid ¶
func (v Completeness) Valid() bool
Valid reports whether the value is named.
type Declarations ¶
type Declarations struct {
NodeLossWindow time.Duration `json:"nodeLossWindow"`
PolledLoss map[Evidence]time.Duration `json:"polledLoss,omitempty"`
CallBound time.Duration `json:"callBound"`
// RequeueSettle is how long after a requeue call lands its restart rise may take to show; on
// Slurm KillWait + 2 x MessageTimeout. Zero without Requeuer (spec 0003 D10).
RequeueSettle time.Duration `json:"requeueSettle,omitempty"`
}
Declarations are an adapter's fixed answers from preflight (spec 0003 D13).
func (Declarations) PollLoses ¶
PollLoses reports the first evidence, in Evidence order, that a poll every interval would lose because its declared window is shorter than the interval, and that window. A zero Execution window means the end is never readable, which no interval can catch, so it bounds no poll (spec 0003 D7).
func (Declarations) Validate ¶
func (d Declarations) Validate() error
Validate refuses a negative duration other than a polled-loss window of Unbounded, and an unknown kind of evidence.
type Discovery ¶
type Discovery struct {
Objects []ObjectObs `json:"objects"`
Complete Completeness `json:"complete"`
Horizon time.Time `json:"horizon,omitzero"`
InFlight bool `json:"inFlight,omitempty"`
// At is when the Find was taken; settlement and gates compare it with recorded call deadlines.
At time.Time `json:"at"`
}
Discovery is every object of a job a Find returned, and how far that can be trusted: absence is never proof that an object does not exist (spec 0003 D6).
type Enforcer ¶
type Enforcer int
Enforcer is who enforces a rule (spec 0001 D9).
The values of Enforcer.
func (Enforcer) MarshalText ¶
MarshalText encodes the value by name.
func (*Enforcer) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type Evidence ¶
type Evidence int
Evidence is a kind of evidence an adapter may lose to polling (spec 0003 D13).
const ( EvidenceState Evidence = iota EvidenceCause EvidenceExitCode // EvidenceExecution is how an ended execution ended: its state and exit, which a Slurm // requeue leaves readable only from accounting (spec 0003 D7). EvidenceExecution // EvidenceExecutionCount is the fact that another execution happened, the restart count. EvidenceExecutionCount )
The values of Evidence.
func (Evidence) MarshalText ¶
MarshalText encodes the value by name.
func (*Evidence) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type ExecutionObs ¶
type ExecutionObs struct {
Token string `json:"token,omitempty"`
Restart int `json:"restart"`
Nodes []string `json:"nodes,omitempty"`
Started time.Time `json:"started,omitzero"`
// Ended is when the execution ended. On an object that still reads Running, it is the
// adapter's proof that the execution is over, and the latest it can have ended.
Ended time.Time `json:"ended,omitzero"`
}
ExecutionObs is one run of a backend object (spec 0003 D13).
type Extension ¶
type Extension interface {
Namespace() string
// Name distinguishes extension types within a namespace; with Namespace it keys the record's
// encoding.
Name() string
}
Extension is a backend-specific JobSpec field. An adapter refuses another namespace with ErrUnsupported, never ignores it (spec 0001 D3).
type Extensions ¶
type Extensions []Extension
Extensions is a JobSpec's extension list. It encodes each element with its namespace and name, and decoding refuses an unregistered type or unknown fields.
func (Extensions) Find ¶
func (e Extensions) Find(namespace, name string) (Extension, bool)
Find returns the first extension in namespace with name, if any.
func (Extensions) MarshalJSON ¶
func (e Extensions) MarshalJSON() ([]byte, error)
MarshalJSON encodes each extension with its namespace and name.
func (*Extensions) UnmarshalJSON ¶
func (e *Extensions) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes registered extension types strictly.
func (Extensions) Validate ¶
func (e Extensions) Validate() error
Validate refuses a nil element, an unnamed one, and the same type twice. It returns every refusal joined, each a ValidationError whose path is the element's index (/1).
type Hold ¶
type Hold struct {
Kind HoldKind `json:"kind"`
By Actor `json:"by"`
Since time.Time `json:"since"`
Until time.Time `json:"until"`
Reason string `json:"reason"`
Overdue bool `json:"overdue"`
}
Hold says who holds a job, since when, until when and why, and whether a live object survives it (spec 0001 D5).
type HoldKind ¶
type HoldKind int
HoldKind is whether a hold keeps a live object or suspends recovery (spec 0001 D5).
func (HoldKind) MarshalText ¶
MarshalText encodes the value by name.
func (*HoldKind) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type HoldMeta ¶
type HoldMeta struct {
Instance uint32 `json:"instance"`
CallMeta
By Actor `json:"by,omitzero"`
Until time.Time `json:"until,omitzero"`
Reason string `json:"reason,omitempty"`
}
HoldMeta names the hold instance a call places or releases, with who placed it, until when and why, from the record's hold control; Instance is at least 1 and allocated by the record (spec 0003 D9). An adapter that can store the rest beside the hold writes them.
type Image ¶
type Image struct {
Ref string `json:"ref"`
}
Image is the container image to run, a capability rather than a field (spec 0001 D2).
type JobID ¶
type JobID string
JobID is dispatch's own identity for a job: a ULID, opaque and stable for the job's life (spec 0001 D10).
func NewJobID ¶
NewJobID returns a ULID for now, drawing its random part from r (crypto/rand when nil), so a simulator can make identities deterministic (spec 0005 D2).
func (JobID) DiscoveryName ¶
DiscoveryName is the constant scheduler name every object of the job carries (spec 0003 D6).
type JobSpec ¶
type JobSpec struct {
Name string `json:"name,omitempty"`
Command []string `json:"command"`
Env map[string]string `json:"env,omitempty"`
WorkDir string `json:"workDir,omitempty"`
Nodes int `json:"nodes"`
GPUsPerNode int `json:"gpusPerNode,omitempty"`
ProcsPerNode int `json:"procsPerNode,omitempty"`
TimeLimit time.Duration `json:"timeLimit,omitempty"`
Checkpoint string `json:"checkpoint,omitempty"`
Recovery RecoveryPolicy `json:"recovery,omitzero"`
Extensions Extensions `json:"extensions,omitempty"`
}
JobSpec is the closed job vocabulary (spec 0001 D2). A field earns its place by meaning something on every backend; backend-specific fields are typed extensions (D3).
func (JobSpec) Validate ¶
Validate refuses what no backend could run, Env keys under DISPATCH_, an invalid policy, and a checkpoint that is neither an absolute POSIX path nor an s3:// URL (spec 0001 D2, D16). It returns every refusal joined, each a ValidationError naming its path (/recovery/rules/0/for).
type Level ¶
type Level int
Level is whether a status is job-level or objects only (spec 0001 D4).
func (Level) MarshalText ¶
MarshalText encodes the value by name.
func (*Level) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type NativeOffer ¶
type NativeOffer struct {
Rules []int `json:"rules,omitempty"`
Data []byte `json:"data,omitempty"`
}
NativeOffer is what an adapter will enforce itself, in its own encoding (spec 0003 D13).
func (NativeOffer) IsZero ¶
func (o NativeOffer) IsZero() bool
IsZero reports whether the offer is empty.
type ObjectObs ¶
type ObjectObs struct {
Ref ObjectRef `json:"ref"`
Submission int `json:"submission"`
Attempt int `json:"attempt"`
Foreign bool `json:"foreign,omitempty"`
Execution ExecutionObs `json:"execution"`
State ObjectState `json:"state"`
AdminHeld bool `json:"adminHeld,omitempty"`
HoldInstance uint32 `json:"holdInstance,omitempty"`
RequeueBit bool `json:"requeueBit,omitempty"`
// RequeueBitBy is the adapter's account of who set the bit, verbatim; empty when it cannot
// tell. The core reports it and never branches on it (spec 0003 D2).
RequeueBitBy string `json:"requeueBitBy,omitempty"`
Cause Cause `json:"cause"`
Seen time.Time `json:"seen"`
}
ObjectObs is what an adapter observed of one object (spec 0003 D2). Foreign marks an object with the job's exact name that is not dispatch's, such as one whose comment does not parse or one cut loose from its gone owner; Cause.Detail says which. It is reported, never dropped.
type ObjectRef ¶
type ObjectRef struct {
Backend string `json:"backend"`
ID string `json:"id"`
UID string `json:"uid,omitempty"`
Submit time.Time `json:"submit,omitzero"`
}
ObjectRef identifies one backend object instance, never just a name (spec 0003 D1, D13). The core hands back refs normalized (see Normal), so an adapter matches Submit by instant.
func (ObjectRef) Normal ¶
Normal returns r with Submit in UTC and without a monotonic reading. ObjectRef is compared with == and used as a map key, and a time keeps its zone and monotonic reading through ==, so the same instance read from a record and from a Find would otherwise differ. A ref an adapter reports after a requeue is matched to the one held with SameObject, not ==.
type ObjectState ¶
type ObjectState int
ObjectState is a backend object's state (spec 0003 D2).
const ( ObjectGated ObjectState = iota ObjectPending ObjectHeld ObjectRunning ObjectEnded )
The values of ObjectState.
func (ObjectState) MarshalText ¶
func (v ObjectState) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (*ObjectState) UnmarshalText ¶
func (v *ObjectState) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (ObjectState) Valid ¶
func (v ObjectState) Valid() bool
Valid reports whether the value is named.
type Output ¶
type Output struct {
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
}
Output names where an execution's stdout and stderr go; it needs OutputPath (spec 0001 D15).
type Plan ¶
type Plan struct {
Job JobID `json:"job"`
Rules []RuleAssignment `json:"rules,omitempty"`
Uncovered []CauseKind `json:"uncovered,omitempty"`
Unverified []Capability `json:"unverified,omitempty"`
UnverifiedRules []Rule `json:"unverifiedRules,omitempty"`
Checkpoint CheckpointMode `json:"checkpoint"`
Unmatched UnmatchedPolicy `json:"unmatched"`
Native NativeOffer `json:"native,omitzero"`
IdentityWeakened string `json:"identityWeakened,omitempty"`
// contains filtered or unexported fields
}
Plan names who enforces each rule, recorded at create so every actor computes the same steps whatever its own configuration (spec 0001 D9). IdentityWeakened is the adapter's reason the job's execution identity is weakened, empty when it is not; the core refuses nothing on it.
func (Plan) Assignment ¶
func (p Plan) Assignment(k CauseKind) (RuleAssignment, bool)
Assignment returns the assignment for the rule covering k, and whether there is one. An unrecognised k has none: a newer build's rule is never applied by this one (spec 0001 D8, amended 2026-11-02).
func (Plan) MarshalJSON ¶ added in v0.3.0
MarshalJSON encodes the plan, writing each unrecognised Uncovered kind's kept name back in its position.
func (Plan) UncoveredNames ¶ added in v0.3.0
UncoveredNames is Uncovered by name, in order, with the names a newer build wrote for unrecognised ones.
type Progress ¶ added in v0.3.0
Progress is an adapter's reading of the beat a launcher publishes for an object: read on demand, never recorded, and no evidence of any state or cause (spec 0003 D1, D13). Seen is on the adapter's clock, when it last saw the beat's seq change, and zero when it has seen no beat. Judged is whether the adapter has held a reading of the object for at least the beat's staleAfter; Stale, that the beat has not changed for that long while the object runs, is set only while Judged.
type Provenance ¶
type Provenance int
Provenance is who reported a cause (spec 0001 D4).
const ( ProvenanceNone Provenance = iota ProvenanceScheduler ProvenanceApplication ProvenanceActor )
The values of Provenance.
func (Provenance) MarshalText ¶
func (v Provenance) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (*Provenance) UnmarshalText ¶
func (v *Provenance) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (Provenance) Valid ¶
func (v Provenance) Valid() bool
Valid reports whether the value is named.
type RecoveryPolicy ¶
type RecoveryPolicy struct {
Rules []Rule `json:"rules,omitempty"`
}
RecoveryPolicy is an ordered list of rules; a rule's index is its identity in budgets and native offers (spec 0003 D13).
func (RecoveryPolicy) RuleFor ¶
func (p RecoveryPolicy) RuleFor(k CauseKind) int
RuleFor returns the index of the rule covering k, or -1 when none does, as for an unrecognised k (spec 0001 D8, amended 2026-11-02).
func (RecoveryPolicy) Validate ¶
func (p RecoveryPolicy) Validate() error
Validate refuses what spec 0001 D8 lists. It also refuses a rule covering None, which is success, or Duplicate, which never affects the job's state (spec 0001 D4): neither can end an execution that recovery could act on. It returns every refusal joined, each a ValidationError whose path is relative to the policy (/rules/0/for).
type Rule ¶
type Rule struct {
On []CauseKind `json:"on"`
Action Action `json:"action"`
Budget int `json:"budget,omitempty"`
For time.Duration `json:"for,omitempty"`
// contains filtered or unexported fields
}
Rule is one recovery rule: the causes it covers, its action, and its budget or hold deadline (spec 0001 D8).
func (Rule) MarshalJSON ¶ added in v0.3.0
MarshalJSON encodes the rule, writing each unrecognised kind's kept name back in its position.
type RuleAssignment ¶
type RuleAssignment struct {
Index int `json:"index"`
Rule Rule `json:"rule"`
Effective Rule `json:"effective"`
Enforcer Enforcer `json:"enforcer"`
Firings int `json:"firings,omitempty"`
}
RuleAssignment is one rule and its enforcer. Under a Shared checkpoint a recovery rule becomes a hold for a person, and Effective shows that hold, so the substitution is visible before the job starts (spec 0001 D16). Firings is how often the rule has fired, from the record.
type RuleSupport ¶
type RuleSupport struct {
Perform Support `json:"perform"`
}
RuleSupport says whether a rule's action can be carried out on this cluster by anyone (spec 0003 D3).
type SharedCheckpoint ¶
type SharedCheckpoint struct{}
SharedCheckpoint declares that the job's checkpoint is shared and mutable, so it cannot isolate executions, and every recovery rule becomes a hold for a person by default (spec 0001 D16).
func (SharedCheckpoint) Namespace ¶
func (SharedCheckpoint) Namespace() string
Namespace implements Extension.
type Source ¶
type Source int
Source is where a support answer came from (spec 0001 D7).
func (Source) MarshalText ¶
MarshalText encodes the value by name.
func (*Source) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type StartRequest ¶
type StartRequest struct {
Job JobID `json:"job"`
Generation int `json:"generation"`
Submission int `json:"submission"`
Attempt int `json:"attempt"`
Spec JobSpec `json:"spec"`
Native NativeOffer `json:"native,omitzero"`
}
StartRequest is one Start call: submission N's attempt, with its identity (spec 0003 D1).
type State ¶
type State int
State is the job's coarse state (spec 0001 D4).
const ( StatePending State = iota StateHeld StateRunning StateRecovering StateSucceeded StateFailed StateCancelled StateUnknown )
The values of State.
func (State) MarshalText ¶
MarshalText encodes the value by name.
func (State) Terminal ¶
Terminal reports whether s is final: Succeeded, Failed and Cancelled never change (spec 0001 D4).
func (*State) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type StopReport ¶
type StopReport struct {
Stopped []ObjectRef `json:"stopped,omitempty"`
Alive []ObjectRef `json:"alive,omitempty"`
Unproven []ObjectRef `json:"unproven,omitempty"`
}
StopReport is the verified result of a job-level stop (spec 0003 D6).
type Support ¶
type Support struct {
Value Tristate `json:"value"`
Source Source `json:"source"`
Reason string `json:"reason,omitempty"`
}
Support is one three-valued answer, with where it came from and why (spec 0001 D7).
type Tristate ¶
type Tristate int
Tristate is three-valued support; Unknown is the zero value (spec 0001 D7).
func (Tristate) MarshalText ¶
MarshalText encodes the value by name.
func (*Tristate) UnmarshalText ¶
UnmarshalText decodes a name, refusing one it does not know.
type UnmatchedPolicy ¶
type UnmatchedPolicy int
UnmatchedPolicy is how an attempt whose outcome stayed unknown affects settlement (spec 0004 D2).
const ( UnmatchedResidual UnmatchedPolicy = iota UnmatchedManual )
The values of UnmatchedPolicy.
func (UnmatchedPolicy) MarshalText ¶
func (v UnmatchedPolicy) MarshalText() ([]byte, error)
MarshalText encodes the value by name.
func (UnmatchedPolicy) String ¶
func (v UnmatchedPolicy) String() string
String returns the value's name.
func (*UnmatchedPolicy) UnmarshalText ¶
func (v *UnmatchedPolicy) UnmarshalText(b []byte) error
UnmarshalText decodes a name, refusing one it does not know.
func (UnmatchedPolicy) Valid ¶
func (v UnmatchedPolicy) Valid() bool
Valid reports whether the value is named.
type ValidationError ¶
ValidationError is one refusal from a Validate method, naming the offending value by JSON Pointer (RFC 6901) over the validated value's JSON field names. It is classified as ErrInvalid.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap classifies the refusal as ErrInvalid.