Documentation ¶
Index ¶
- type DB
- func (d *DB) Close() error
- func (d *DB) Get(ctx context.Context, key string) ([]byte, error)
- func (d *DB) GetKeys(ctx context.Context, prefix string) ([]string, error)
- func (d *DB) NewTransaction(ctx context.Context, update bool) (database.Transaction, context.Context, error)
- func (d *DB) Ping(ctx context.Context) error
- func (d *DB) Set(ctx context.Context, key string, v []byte) error
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) NewTransaction ¶
func (d *DB) NewTransaction(ctx context.Context, update bool) (database.Transaction, context.Context, error)
NewTransaction starts a new transaction. The `update` parameter controls the access mode ("read only" or "read write"). It returns the transaction as well as a context that contains the transaction. Passing the context in future calls to *DB will execute that action in that transaction.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) Discard ¶
func (t *Transaction) Discard()
Click to show internal directories.
Click to hide internal directories.