Documentation ¶
Index ¶
- Variables
- func Register(name string, factory Factory) error
- type Batcher
- type Factory
- type InjectBase
- func (i *InjectBase) Delete(key string) error
- func (i *InjectBase) Get(key string) (record.Record, error)
- func (i *InjectBase) Injected() bool
- func (i *InjectBase) Maintain(ctx context.Context) error
- func (i *InjectBase) MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time) error
- func (i *InjectBase) MaintainThorough(ctx context.Context) error
- func (i *InjectBase) Put(m record.Record) (record.Record, error)
- func (i *InjectBase) PutMany() (batch chan record.Record, err chan error)
- func (i *InjectBase) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)
- func (i *InjectBase) ReadOnly() bool
- func (i *InjectBase) Shutdown() error
- type Interface
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("storage entry not found")
)
Errors for storages
Functions ¶
Types ¶
type Batcher ¶ added in v0.5.0
Batcher defines the database storage API for backends that support batch operations.
type InjectBase ¶
type InjectBase struct{}
InjectBase is a dummy base structure to reduce boilerplate code for injected storage interfaces.
func (*InjectBase) Delete ¶
func (i *InjectBase) Delete(key string) error
Delete deletes a record from the database.
func (*InjectBase) Get ¶
func (i *InjectBase) Get(key string) (record.Record, error)
Get returns a database record.
func (*InjectBase) Injected ¶
func (i *InjectBase) Injected() bool
Injected returns whether the database is injected.
func (*InjectBase) Maintain ¶
func (i *InjectBase) Maintain(ctx context.Context) error
Maintain runs a light maintenance operation on the database.
func (*InjectBase) MaintainRecordStates ¶ added in v0.5.2
MaintainRecordStates maintains records states in the database.
func (*InjectBase) MaintainThorough ¶
func (i *InjectBase) MaintainThorough(ctx context.Context) error
MaintainThorough runs a thorough maintenance operation on the database.
func (*InjectBase) PutMany ¶ added in v0.5.0
func (i *InjectBase) PutMany() (batch chan record.Record, err chan error)
PutMany stores many records in the database.
func (*InjectBase) ReadOnly ¶
func (i *InjectBase) ReadOnly() bool
ReadOnly returns whether the database is read only.
func (*InjectBase) Shutdown ¶
func (i *InjectBase) Shutdown() error
Shutdown shuts down the database.
type Interface ¶
type Interface interface { Get(key string) (record.Record, error) Put(m record.Record) (record.Record, error) Delete(key string) error Query(q *query.Query, local, internal bool) (*iterator.Iterator, error) ReadOnly() bool Injected() bool Maintain(ctx context.Context) error MaintainThorough(ctx context.Context) error MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time) error Shutdown() error }
Interface defines the database storage API.
func CreateDatabase ¶
CreateDatabase starts a new database with the given name and storageType at location.
func StartDatabase ¶
StartDatabase starts a new database with the given name and storageType at location.