Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidULID ¶ added in v0.8.1
IsValidULID reports whether s is a well-formed 26-character Crockford base32 ULID. It does not check whether the timestamp or random portion is semantically valid — only the length and character set.
Types ¶
type Action ¶
type Action string
Action represents the kind of mutation applied to a Trace.
const ( ActionCreate Action = "create" ActionUpdate Action = "update" ActionArchive Action = "archive" ActionUnarchive Action = "unarchive" ActionTrash Action = "trash" ActionRecover Action = "recover" ActionPurge Action = "purge" // Memory-tiering actions. See docs/plans/consolidation-plan.md. // These constants ship in Phase 2 so federation event replay doesn't // encounter unknown actions mid-rollout once later phases start // emitting them. ActionPromote Action = "promote" ActionDemote Action = "demote" ActionConsolidate Action = "consolidate" ActionConsolidateFallback Action = "consolidate_fallback" ActionDivergenceLongTerm Action = "divergence_long_term" ActionVote Action = "vote" ActionPurgeLongTerm Action = "purge_long_term" ActionPurgeHard Action = "purge_hard" // Multi-peer consolidation coordination. See consolidation-plan.md §14. // Ship alongside the rank-advertisement foundation so federation event // replay doesn't encounter unknown actions once later phases start // emitting them. ActionConsolidationClaim Action = "consolidation_claim" ActionConsolidationSuccess Action = "consolidation_success" ActionConsolidationFail Action = "consolidation_fail" )
type Event ¶
type Event struct {
ID string `json:"id"` // ULID
Action Action `json:"action"`
TraceID string `json:"trace_id"`
CortexID string `json:"cortex_id"` // stable ULID identity (federation key)
Origin string `json:"origin"` // display name at write time
Timestamp string `json:"timestamp"` // RFC3339 UTC
Data json.RawMessage `json:"data,omitempty"` // action-specific payload
VClock map[string]uint64 `json:"vclock,omitempty"` // vector clock keyed on cortex IDs
}
Event is an immutable record of a mutation to a Trace.
CortexID is the stable ULID identity of the cortex that produced the event. Origin is the human-readable display name at the time of writing — it can drift if the cortex is renamed and is never trusted for identity decisions on replay. Federation, vector clocks, and divergence detection all key on CortexID; Origin is purely for audit-trail rendering.