Documentation
¶
Overview ¶
Package sessionretention contains the side-effect-free retention selection policy.
Index ¶
Constants ¶
View Source
const ( // ReasonAge identifies a candidate selected by its age limit. ReasonAge = "age" // ReasonCap identifies a candidate selected by its family count limit. ReasonCap = "cap" // ProtectedUnknown identifies missing or invalid durable taxonomy. ProtectedUnknown = "unknown_taxonomy" // ProtectedState identifies a running or awaiting durable state. ProtectedState = "active_state" // ProtectedLive identifies an in-process live session. ProtectedLive = "live" // ProtectedLeased identifies a session currently leased for mutation. ProtectedLeased = "leased" // ProtectedForeign identifies a row outside the caller-bound scope. ProtectedForeign = "foreign_owner" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counts ¶
type Counts struct {
Total int
ByKind map[session.SessionKind]int
ByState map[session.State]int
ByReason map[string]int
}
Counts is a stable aggregate projection.
type Item ¶
type Item struct {
ID session.SessionID
Kind session.SessionKind
State session.State
ModifiedAt time.Time
EstimatedBytes int64
Reason string
OwnerKey string
Metadata port.SessionDiscoveryMeta `json:"-"`
}
Item is content-free retention metadata for one row.
type Policy ¶
type Policy struct {
Version string
MainMaxAge time.Duration
MainMaxCount int
ChildMaxAge time.Duration
ChildMaxCount int
ScheduledMaxAge time.Duration
ScheduledMaxCount int
}
Policy is the effective retention policy consumed by both sweep and manual paths.
type Result ¶
Result is a deterministic plan. It contains no transcript or tool content.
func Plan ¶
func Plan(rows []port.SessionDiscoveryMeta, policy Policy, scope Scope, protection RuntimeProtection, now time.Time) Result
Plan selects oldest-first candidates without performing I/O or mutation.
type RuntimeProtection ¶
RuntimeProtection is a read-only snapshot of facts outside durable metadata.
Click to show internal directories.
Click to hide internal directories.