Versions in this module Expand all Collapse all v0 v0.3.0 Oct 26, 2026 Changes in this version + const Canceled + const Failed + const Running + const Succeeded + const Unknown + var ErrActiveStages = errors.New("timeline: operation still has active stages") + var ErrEmptyID = model.ErrEmptyID + var ErrInvalidAttribute = model.ErrInvalidAttribute + var ErrInvalidStage = model.ErrInvalidStage + var ErrNotStarted = errors.New("timeline: operation attributes require a locally recorded start") + func NewContext(ctx context.Context, t Timeline) context.Context + func NewStageContext(ctx context.Context, ref StageRef) context.Context + type Actor = model.Actor + type Attribute struct + Key string + Value any + type Collection = model.Collection + type EndOption func(*Stage) error + func WithCode(code string) EndOption + func WithEndActor(actor Actor) EndOption + func WithEndAttributes(attributes ...Attribute) EndOption + func WithEndTime(at time.Time) EndOption + type Handle struct + func NewHandle(id string, options ...Option) (*Handle, error) + func (h *Handle) Begin(name string, options ...StageOption) StageHandle + func (h *Handle) Err() error + func (h *Handle) Finish(ctx context.Context, err error) (Snapshot, error) + func (h *Handle) Flush(ctx context.Context) error + func (h *Handle) ID() string + func (h *Handle) Record(stage Stage) error + func (h *Handle) SetAttributes(attributes ...Attribute) + func (h *Handle) Snapshot(ctx context.Context) (Snapshot, error) + func (h *Handle) Start(ctx context.Context, operation string, attributes ...Attribute) error + func (h *Handle) UpdateAttributes(attributes ...Attribute) error + type Option func(*recorder) + func WithActor(actor Actor) Option + func WithStore(backend store.Store) Option + type Snapshot = model.Snapshot + type Stage = model.Stage + type StageHandle interface + End func(err error, opts ...EndOption) error + ID func() StageID + SetAttributes func(attributes ...Attribute) error + func BeginWithContext(ctx context.Context, t Timeline, name string, opts ...StageOption) (context.Context, StageHandle) + type StageID = model.StageID + type StageOption func(*Stage) error + func WithAttributes(attributes ...Attribute) StageOption + func WithParent(id StageID) StageOption + func WithStageActor(actor Actor) StageOption + func WithStageID(id StageID) StageOption + func WithStartTime(at time.Time) StageOption + type StageRef struct + StageID StageID + TimelineID string + func StageFromContext(ctx context.Context) (StageRef, bool) + type Status = model.Status + type Timeline interface + Begin func(name string, opts ...StageOption) StageHandle + Finish func(ctx context.Context, operationErr error) (Snapshot, error) + Flush func(context.Context) error + ID func() string + Record func(Stage) error + SetAttributes func(attributes ...Attribute) + Snapshot func(ctx context.Context) (Snapshot, error) + func FromContext(ctx context.Context) (Timeline, bool) + func Noop(id string) Timeline v0.1.0 Oct 10, 2026 Changes in this version + var ErrAmbiguousStage = errors.New("timeline manager: multiple running stages share this name") + var ErrBufferFull = errors.New("timeline manager: pending save limit exceeded") + var ErrClosed = errors.New("timeline manager: shut down") + var ErrNoDefault = errors.New("timeline manager: no default installed") + var ErrStageNotFound = errors.New("timeline manager: stage not found") + func Begin(id, name string, options ...timeline.StageOption) (timeline.StageHandle, error) + func End(id, name string, stageErr error, options ...timeline.EndOption) error + func Finish(id string, operationErr error) error + func Read(ctx context.Context, id string) (timeline.Snapshot, error) + func Record(id string, stage timeline.Stage) error + func Start(id, operation string, attributes ...timeline.Attribute) error + type Config struct + ExportTimeout time.Duration + FlushInterval time.Duration + MaxPendingTimelines int + MaxPendingUpdates int + MaxTimelines int + OnError func(id string, err error) + type Manager struct + func New(backend store.Store, config Config) (*Manager, error) + func SetDefault(m *Manager) *Manager + func (c *Manager) Evict(id string) + func (c *Manager) Flush(ctx context.Context) error + func (c *Manager) FlushID(ctx context.Context, id string) error + func (c *Manager) Read(ctx context.Context, id string) (model.Snapshot, error) + func (c *Manager) Shutdown(ctx context.Context) error + func (c *Manager) Stats() Stats + func (m *Manager) Begin(id, name string, options ...timeline.StageOption) (timeline.StageHandle, error) + func (m *Manager) BeginContext(ctx context.Context, id, name string, options ...timeline.StageOption) (context.Context, timeline.StageHandle, error) + func (m *Manager) End(id, name string, stageErr error, options ...timeline.EndOption) error + func (m *Manager) Finish(id string, operationErr error) error + func (m *Manager) NewWriter(id string, actor timeline.Actor) (*timeline.Recorder, error) + func (m *Manager) Record(id string, data timeline.Stage) error + func (m *Manager) Start(id, operation string, attributes ...timeline.Attribute) error + type Stats struct + CachedTimelines int + DroppedUpdates uint64 + PendingTimelines int + PendingUpdates int + RejectedUpdates uint64