incidentstore

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package incidentstore persists the Incidentius event stream in a repository.

Index

Constants

This section is empty.

Variables

View Source
var ErrIncidentNotFound = errors.New("incident not found")

Functions

This section is empty.

Types

type RepositoryRoots

type RepositoryRoots struct {
	Application string
	Dedicated   map[string]string
	Projects    map[incidents.ProjectRef]string
}

RepositoryRoots resolves every supported StoreLocation to its checked-out Git repository root. The caller owns cloning, authentication, and sync.

type RepositoryStore

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

RepositoryStore owns one configured incident repository. Project, dedicated, and application repositories use this same implementation and layout; routing decides only which root is supplied.

func NewRepositoryStore

func NewRepositoryStore(location incidents.StoreLocation, root string) (*RepositoryStore, error)

func OpenLocation

func OpenLocation(location incidents.StoreLocation, roots RepositoryRoots) (*RepositoryStore, error)

OpenLocation resolves a store location and opens its repository-backed incident store. It keeps location selection separate from persistence so project, dedicated, and application repositories cannot silently share a fallback directory.

func (*RepositoryStore) Append

func (s *RepositoryStore) Append(ctx context.Context, mutation incidents.Mutation) (result incidents.AppendResult, err error)

func (*RepositoryStore) Close

func (s *RepositoryStore) Close() error

Close releases the root directory handle held by the store.

func (*RepositoryStore) Events

func (s *RepositoryStore) Events(ctx context.Context, ref incidents.IncidentRef, afterSeq uint64) (events []incidents.Event, err error)

func (*RepositoryStore) Merge

func (s *RepositoryStore) Merge(ctx context.Context, mutation incidents.MergeMutation) (result incidents.MergeResult, err error)

func (*RepositoryStore) Projection

func (s *RepositoryStore) Projection(ctx context.Context, ref incidents.IncidentRef, at *time.Time) (projection incidents.Incident, err error)

Jump to

Keyboard shortcuts

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