Documentation
¶
Overview ¶
Package incidentstore persists the Incidentius event stream in a repository.
Index ¶
- Variables
- type RepositoryRoots
- type RepositoryStore
- func (s *RepositoryStore) Append(ctx context.Context, mutation incidents.Mutation) (result incidents.AppendResult, err error)
- func (s *RepositoryStore) Close() error
- func (s *RepositoryStore) Events(ctx context.Context, ref incidents.IncidentRef, afterSeq uint64) (events []incidents.Event, err error)
- func (s *RepositoryStore) Merge(ctx context.Context, mutation incidents.MergeMutation) (result incidents.MergeResult, err error)
- func (s *RepositoryStore) Projection(ctx context.Context, ref incidents.IncidentRef, at *time.Time) (projection incidents.Incident, err error)
Constants ¶
This section is empty.
Variables ¶
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)