Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("annotation not found")
ErrNotFound is returned when an annotation does not exist.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct {
ID string `json:"id"`
Title string `json:"title"`
Body string `json:"body"`
Author string `json:"author"`
Timestamp time.Time `json:"timestamp"`
Tags []string `json:"tags"` // e.g., "deploy", "incident", "config-change"
Service string `json:"service,omitempty"`
}
Annotation marks an event on a metric timeline.
type Store ¶
type Store struct {
PersistFunc func(annotations []Annotation) // called after any mutation, if non-nil
// contains filtered or unexported fields
}
Store provides in-memory storage for annotations.
func NewStoreWithData ¶
func NewStoreWithData(data []Annotation) *Store
NewStoreWithData creates an annotation store pre-loaded with data.
func (*Store) Create ¶
func (s *Store) Create(a Annotation) error
Create adds an annotation to the store, assigning an ID if empty.
Click to show internal directories.
Click to hide internal directories.