annotations

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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 Open

func Open(dir string) (*Store, error)

Open opens (or creates) the annotations sidecar at dir.

func (*Store) Close

func (s *Store) Close() error

Close releases the underlying database.

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete removes all annotations for an entity.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL