Documentation
¶
Index ¶
- Variables
- func Start(ctx context.Context, dataDir string) (func(), error)
- type Database
- type Transaction
- func (t *Transaction) Ascend(ctx context.Context, beg, end string, errp *error) iter.Seq2[string, io.Reader]
- func (t *Transaction) Commit(ctx context.Context) error
- func (t *Transaction) Delete(ctx context.Context, k string) error
- func (t *Transaction) Descend(ctx context.Context, beg, end string, errp *error) iter.Seq2[string, io.Reader]
- func (t *Transaction) Discard(ctx context.Context) error
- func (t *Transaction) Get(ctx context.Context, k string) (io.Reader, error)
- func (t *Transaction) Rollback(ctx context.Context) error
- func (t *Transaction) Set(ctx context.Context, k string, v io.Reader) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PgctlBinaryPath = ""
PgctlBinaryPath variable contains the path to `pg_ctl` binary. When empty exec.LookPath will be used to find the binary.
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func Connect ¶
Connect creates a db instance using an already running database server at the given directory.
func New ¶
New creates a key-value store (if it doesn't exist) backed by a private postgres instance.
func (*Database) NewSnapshot ¶
func (d *Database) NewSnapshot(ctx context.Context) (*Transaction, error)
NewSnapshot creates a read-only snapshot of the key-value database.
func (*Database) NewTransaction ¶
func (d *Database) NewTransaction(ctx context.Context) (*Transaction, error)
NewTransaction creates a new transaction.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Commit ¶
func (t *Transaction) Commit(ctx context.Context) error
Commit commits a transaction.
func (*Transaction) Delete ¶
func (t *Transaction) Delete(ctx context.Context, k string) error
Delete removes a key-value pair.
func (*Transaction) Descend ¶
func (t *Transaction) Descend(ctx context.Context, beg, end string, errp *error) iter.Seq2[string, io.Reader]
Descend returns key-value pairs in a given range, in descending order.
func (*Transaction) Discard ¶
func (t *Transaction) Discard(ctx context.Context) error
Discard releases a snapshot.
Click to show internal directories.
Click to hide internal directories.