Documentation
¶
Index ¶
- Variables
- func DefaultDBPath() string
- type Clock
- type Option
- type StoreFactory
- func (f *StoreFactory) AsyncSearchStore(_ context.Context) (spi.AsyncSearchStore, error)
- func (f *StoreFactory) Close() error
- func (f *StoreFactory) EntityStore(ctx context.Context) (spi.EntityStore, error)
- func (f *StoreFactory) KeyValueStore(ctx context.Context) (spi.KeyValueStore, error)
- func (f *StoreFactory) MessageStore(ctx context.Context) (spi.MessageStore, error)
- func (f *StoreFactory) ModelStore(ctx context.Context) (spi.ModelStore, error)
- func (f *StoreFactory) StateMachineAuditStore(ctx context.Context) (spi.StateMachineAuditStore, error)
- func (f *StoreFactory) TransactionManager(_ context.Context) (spi.TransactionManager, error)
- func (f *StoreFactory) WorkflowStore(ctx context.Context) (spi.WorkflowStore, error)
- type TestClock
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFilterPath = errors.New("invalid filter path")
ErrInvalidFilterPath is returned when a Filter.Path or OrderSpec.Path contains characters that could break out of a JSON-path literal in a json_extract expression. Sentinel for callers that want to distinguish input validation errors from storage errors.
var ErrScanBudgetExhausted = errors.New("scan budget exhausted")
ErrScanBudgetExhausted is returned when a search with a residual filter examines more rows than the configured SearchScanLimit without filling the requested result page. Callers should tighten their filter.
Functions ¶
func DefaultDBPath ¶
func DefaultDBPath() string
DefaultDBPath returns the per-OS default path for the sqlite database file. Linux and macOS share XDG semantics ($XDG_DATA_HOME/cyoda/cyoda.db, fallback ~/.local/share/cyoda/cyoda.db). Windows uses %LocalAppData%\cyoda\ cyoda.db. Returns the literal "cyoda.db" (current directory) when the user home directory cannot be determined.
Types ¶
type Clock ¶
Clock abstracts time.Now so tests can advance it deterministically. Production uses wallClock; conformance tests use TestClock.
type StoreFactory ¶
type StoreFactory struct {
// contains filtered or unexported fields
}
StoreFactory implements spi.StoreFactory backed by SQLite.
func NewStoreFactoryForTest ¶
func NewStoreFactoryForTest(ctx context.Context, dbPath string, opts ...Option) (*StoreFactory, error)
NewStoreFactoryForTest creates a factory with auto-migrate enabled and the given path. Intended for test use only.
func NewStoreFactoryForTestWithScanLimit ¶
func NewStoreFactoryForTestWithScanLimit(ctx context.Context, dbPath string, scanLimit int, opts ...Option) (*StoreFactory, error)
NewStoreFactoryForTestWithScanLimit creates a factory with a custom scan limit for testing scan budget exhaustion. Intended for test use only.
func (*StoreFactory) AsyncSearchStore ¶
func (f *StoreFactory) AsyncSearchStore(_ context.Context) (spi.AsyncSearchStore, error)
func (*StoreFactory) Close ¶
func (f *StoreFactory) Close() error
func (*StoreFactory) EntityStore ¶
func (f *StoreFactory) EntityStore(ctx context.Context) (spi.EntityStore, error)
func (*StoreFactory) KeyValueStore ¶
func (f *StoreFactory) KeyValueStore(ctx context.Context) (spi.KeyValueStore, error)
func (*StoreFactory) MessageStore ¶
func (f *StoreFactory) MessageStore(ctx context.Context) (spi.MessageStore, error)
func (*StoreFactory) ModelStore ¶
func (f *StoreFactory) ModelStore(ctx context.Context) (spi.ModelStore, error)
func (*StoreFactory) StateMachineAuditStore ¶
func (f *StoreFactory) StateMachineAuditStore(ctx context.Context) (spi.StateMachineAuditStore, error)
func (*StoreFactory) TransactionManager ¶
func (f *StoreFactory) TransactionManager(_ context.Context) (spi.TransactionManager, error)
TransactionManager implements spi.StoreFactory. Returns the TM registered via initTransactionManager. Errors if none is set.
func (*StoreFactory) WorkflowStore ¶
func (f *StoreFactory) WorkflowStore(ctx context.Context) (spi.WorkflowStore, error)
type TestClock ¶
type TestClock struct {
// contains filtered or unexported fields
}
TestClock is a mutable clock for tests. Advance(d) moves it forward; Now returns the current virtual time. Safe for concurrent use.
func NewTestClock ¶
func NewTestClock() *TestClock
NewTestClock returns a TestClock starting at the current wall-clock time.