Documentation
¶
Index ¶
- func GetRead(ctx context.Context) (datastore.Read, bool)
- func GetWrite(ctx context.Context) (datastore.Write, bool)
- func WithRead(ctx context.Context, batch datastore.Read) context.Context
- func WithWrite(ctx context.Context, batch datastore.Write) context.Context
- func WrapDatastore(ds datastore.Datastore) datastore.Datastore
- type Datastore
- func (ds *Datastore) Batch(ctx context.Context) (datastore.Batch, error)
- func (ds *Datastore) Close() error
- func (ds *Datastore) Delete(ctx context.Context, key datastore.Key) error
- func (ds *Datastore) Get(ctx context.Context, key datastore.Key) ([]byte, error)
- func (ds *Datastore) GetSize(ctx context.Context, key datastore.Key) (int, error)
- func (ds *Datastore) Has(ctx context.Context, key datastore.Key) (bool, error)
- func (ds *Datastore) NewTransaction(ctx context.Context, readOnly bool) (datastore.Txn, error)
- func (ds *Datastore) Put(ctx context.Context, key datastore.Key, value []byte) error
- func (ds *Datastore) Query(ctx context.Context, q query.Query) (query.Results, error)
- func (ds *Datastore) Sync(ctx context.Context, prefix datastore.Key) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapDatastore ¶
func WrapDatastore(ds datastore.Datastore) datastore.Datastore
WrapsDatastore wraps around the given datastore.Datastore making its operations context-aware It intercepts datastore operations routing them to the current Write or Read if one exists on the context.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is a wrapper around a datastore.Datastore that provides context-aware operations. See WrapDatastore.
func (*Datastore) NewTransaction ¶
Click to show internal directories.
Click to hide internal directories.