memory

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements incident.IncidentStore using a mutex-protected slice.

func NewStore

func NewStore() *Store

NewStore creates a new in-memory incident store.

func (*Store) AddComment

func (s *Store) AddComment(incidentID string, comment incident.Comment) error

AddComment appends a comment to the given incident.

func (*Store) FindActiveByKey

func (s *Store) FindActiveByKey(_ context.Context, service, deployID string, since time.Time) (*incident.Incident, error)

FindActiveByKey returns the most recent active or acknowledged incident matching the given service and optional deploy ID, with LastSeen after since.

func (*Store) Get

func (s *Store) Get(_ context.Context, id string) (*incident.Incident, error)

Get returns the incident with the given ID, or ErrNotFound.

func (*Store) GetComments

func (s *Store) GetComments(incidentID string) ([]incident.Comment, error)

GetComments returns all comments for the given incident, ordered by creation time.

func (*Store) List

List returns incidents matching the filter, newest first (by FirstSeen).

func (*Store) Save

func (s *Store) Save(_ context.Context, inc *incident.Incident) error

Save appends the incident. If inc.ID is empty, a UUID is generated.

func (*Store) Update

func (s *Store) Update(_ context.Context, inc *incident.Incident) error

Update finds the incident by ID and replaces it entirely.

Jump to

Keyboard shortcuts

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