Documentation ¶
Index ¶
- type BatchConfig
- type BatchOption
- type Config
- type Option
- type Store
- func (s Store) Add(ctx context.Context, collection string, v interface{}) error
- func (s Store) All(ctx context.Context, spec db.Spec, v interface{}, opts ...BatchOption) error
- func (s Store) Batch(ctx context.Context, batch db.Batch, opts ...BatchOption) error
- func (s Store) Begin(ctx context.Context, opts ...db.TxOption) (Txn, error)
- func (s Store) Do(ctx context.Context, fn func(tx Txn) error, opts ...db.TxOption) error
- func (s Store) Edit(ctx context.Context, collection string, spec db.Spec, v interface{}) error
- func (s Store) One(ctx context.Context, spec db.Spec, v interface{}, opts ...BatchOption) error
- func (s Store) Remove(ctx context.Context, collection string, spec db.Spec) error
- type Txn
- func (tx *Txn) Add(collection string, v interface{}) error
- func (tx *Txn) All(spec db.Spec, v interface{}, opts ...BatchOption) error
- func (tx *Txn) Batch(batch db.Batch, opts ...BatchOption) error
- func (tx *Txn) Context() context.Context
- func (tx *Txn) Edit(collection string, spec db.Spec, v interface{}) error
- func (tx *Txn) One(spec db.Spec, v interface{}, opts ...BatchOption) error
- func (tx *Txn) Remove(collection string, spec db.Spec) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchConfig ¶ added in v1.2.0
BatchConfig configuration for store batch operations
type BatchOption ¶ added in v1.2.0
type BatchOption func(conf *BatchConfig)
BatchOption for customizing store batch operations
func QueryTTL ¶
func QueryTTL(duration time.Duration) BatchOption
QueryTTL custom duration of time to cache queries for
type Option ¶
type Option func(conf *Config)
Option A store configuration option
func WithMigration ¶
WithMigration Use database migration
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store an abstraction over database persistence
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn A unit of work
func (*Txn) All ¶
func (tx *Txn) All(spec db.Spec, v interface{}, opts ...BatchOption) error
All retrieves a listing of values
func (*Txn) Batch ¶ added in v1.0.3
func (tx *Txn) Batch(batch db.Batch, opts ...BatchOption) error
Batch performs a batch query op within a transaction
Click to show internal directories.
Click to hide internal directories.