Documentation
¶
Overview ¶
Package runstate encodes storage states that fence unsupported workers.
Index ¶
- Constants
- func Decode(stored string) run.State
- func DecodeProgress(stored string, p *suspension.Progress) error
- func DecodeReady(stored *string) (*run.Readiness, error)
- func Encode(r *run.Run) string
- func EncodeProgress(p *suspension.Progress) (string, error)
- func EncodeReady(ready *run.Readiness) (*string, error)
- func LeaseColumns(lease *run.Lease) (string, *time.Time)
- func LeaseFromColumns(owner string, expiresAt *time.Time) *run.Lease
- func NextRevision(current int64) (int64, error)
- func UTCTime(t *time.Time) *time.Time
- func UpdateConflict(ctx context.Context, reader interface{ ... }, scope cortex.Scope, ...) error
Constants ¶
const PausedPrepared = "paused_prepared"
PausedPrepared is deliberately unknown to readers predating preparation. Their atomic resume and expiry claims match only the literal paused state.
Variables ¶
This section is empty.
Functions ¶
func DecodeProgress ¶ added in v1.10.0
func DecodeProgress(stored string, p *suspension.Progress) error
DecodeProgress reverses EncodeProgress into p.
func DecodeReady ¶ added in v1.10.0
DecodeReady reverses EncodeReady.
func EncodeProgress ¶ added in v1.10.0
func EncodeProgress(p *suspension.Progress) (string, error)
EncodeProgress returns the SQL column value for a progress snapshot.
func EncodeReady ¶ added in v1.10.0
EncodeReady returns the SQL column value for a run's readiness. Nil is stored as NULL.
func LeaseColumns ¶ added in v1.10.0
LeaseColumns splits a run's lease into its owner and expiry columns. A zero lease, or none, is stored as no owner and a NULL expiry, which no lapsed listing ever matches.
func LeaseFromColumns ¶ added in v1.10.0
LeaseFromColumns reverses LeaseColumns.
func NextRevision ¶
NextRevision rejects invalid or exhausted versions without wrapping around.
func UpdateConflict ¶
func UpdateConflict(ctx context.Context, reader interface { GetRun(context.Context, id.AgentRunID) (*run.Run, error) }, scope cortex.Scope, runID id.AgentRunID) error
UpdateConflict classifies a failed conditional write without exposing a run outside the exact caller scope. The read is diagnostic, never write authority.
Types ¶
This section is empty.