Documentation
¶
Overview ¶
Package annotations is the operator-added overlay on entities: free-form key/value notes a human or an assistant attaches to an entity (owner, runbook link, ticket, a remark). It is NOT producer truth — it lives in a per-tenant Pebble sidecar, separate from the event log, and never enters the projection or replay (0.7.0). Annotations key on the entity's logical id, so they survive identity changes and re-attach if the entity resurrects (#183).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct {
Values map[string]string `json:"values"`
Author string `json:"author,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
Annotation is the overlay on one entity: the merged key/values plus who last wrote them and when.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a per-tenant key/value sidecar keyed by entity logical id. It is a distinct Pebble database, never part of the event log or its replay.
func (*Store) Get ¶
func (s *Store) Get(id string) (Annotation, bool, error)
Get returns the entity's annotation, or ok=false if it has none.
func (*Store) Set ¶
func (s *Store) Set(id string, values map[string]string, author string, now time.Time) (Annotation, error)
Set merges values into the entity's annotation (upsert): a key with an empty value removes that key; author and the timestamp are recorded. When no values remain the row is deleted. Returns the resulting annotation.