Documentation
¶
Overview ¶
Package checkpoint owns bounded, non-secret plugin state scoped to one authenticated plugin instance generation.
Index ¶
Constants ¶
const ( MaxDataBytes = protocol.MaxCheckpointObjectBytes MaxAggregateDataBytes = 16 << 20 )
Variables ¶
This section is empty.
Functions ¶
func DefaultRoot ¶
DefaultRoot returns the checkpoint directory beside one daemon config.
Types ¶
type DiagnosticCode ¶
type DiagnosticCode string
DiagnosticCode is a stable, content-free checkpoint failure category.
const ( InvalidCode DiagnosticCode = "checkpoint_invalid" CapacityCode DiagnosticCode = "checkpoint_capacity_exceeded" CommitFailedCode DiagnosticCode = "checkpoint_commit_failed" DurabilityUncertainCode DiagnosticCode = "checkpoint_durability_uncertain" CorruptCode DiagnosticCode = "checkpoint_corrupt" IOFailedCode DiagnosticCode = "checkpoint_io_failed" )
type Error ¶
type Error struct {
Code DiagnosticCode
Outcome localstate.CommitOutcome
Err error
}
Error exposes a stable diagnostic and commit outcome without rendering a checkpoint identity, payload, or underlying path.
type Status ¶
type Status struct {
Files int `json:"files"`
DataBytes int `json:"data_bytes"`
Failures uint64 `json:"failures"`
Corruptions uint64 `json:"corruptions"`
LastErrorCode DiagnosticCode `json:"last_error_code,omitempty"`
}
Status is safe for daemon diagnostics. It contains counts and stable codes, never identities or checkpoint data.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store serializes bounded checkpoint I/O under one lock.
func (*Store) Load ¶
Load returns a deep copy only for an exact identity and generation. Corrupt, mismatched, and oversized files are removed and never delivered.
func (*Store) Reconcile ¶
Reconcile removes every checkpoint not in the exact active generation set.
func (*Store) Save ¶
func (s *Store) Save(key Key, data json.RawMessage) (localstate.CommitOutcome, error)
Save validates and atomically replaces one non-secret JSON checkpoint.