Documentation
¶
Overview ¶
Package store defines the persistence layer interfaces. Only this package and its sub-packages may import database drivers. Business logic always depends on these interfaces, never on concrete implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("store: not found")
ErrNotFound is returned by lookups when the entity does not exist.
Functions ¶
This section is empty.
Types ¶
type GlobalConfigRepository ¶
type GlobalConfigRepository interface {
Get(ctx context.Context) (*domain.GlobalConfig, error)
Set(ctx context.Context, cfg *domain.GlobalConfig) error
}
GlobalConfigRepository persists the runtime GlobalConfig.
type HookRepository ¶
type HookRepository interface {
Save(ctx context.Context, hook *domain.Hook) error
FindByID(ctx context.Context, id domain.HookID) (*domain.Hook, error)
List(ctx context.Context) ([]*domain.Hook, error)
Delete(ctx context.Context, id domain.HookID) error
}
HookRepository persists registered webhook/integration configurations.
type RecordingRepository ¶
type RecordingRepository interface {
Save(ctx context.Context, rec *domain.Recording) error
FindByID(ctx context.Context, id domain.RecordingID) (*domain.Recording, error)
ListByStream(ctx context.Context, streamCode domain.StreamCode) ([]*domain.Recording, error)
Delete(ctx context.Context, id domain.RecordingID) error
}
RecordingRepository persists DVR recording metadata.
type StreamFilter ¶
type StreamFilter struct{}
StreamFilter holds optional filters for listing streams. Stream status is runtime-only and never persisted, so there is no Status filter here; callers that need status filtering must do so after querying the coordinator.
type StreamRepository ¶
type StreamRepository interface {
Save(ctx context.Context, stream *domain.Stream) error
FindByCode(ctx context.Context, code domain.StreamCode) (*domain.Stream, error)
List(ctx context.Context, filter StreamFilter) ([]*domain.Stream, error)
Delete(ctx context.Context, code domain.StreamCode) error
}
StreamRepository persists stream configurations and state.
type VODMountRepository ¶
type VODMountRepository interface {
Save(ctx context.Context, mount *domain.VODMount) error
FindByName(ctx context.Context, name domain.VODName) (*domain.VODMount, error)
List(ctx context.Context) ([]*domain.VODMount, error)
Delete(ctx context.Context, name domain.VODName) error
}
VODMountRepository persists VOD mount registrations (name → host storage path). File contents are never indexed — only the mount table itself is stored here.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package json provides a single-file JSON implementation of the store repositories.
|
Package json provides a single-file JSON implementation of the store repositories. |
|
Package storetest provides shared test fixtures for all store implementations.
|
Package storetest provides shared test fixtures for all store implementations. |
|
Package yaml provides a single-file YAML implementation of the store repositories.
|
Package yaml provides a single-file YAML implementation of the store repositories. |