Documentation
¶
Overview ¶
Package lmdbenv implements several utilities for working with LMDB databases.
Index ¶
- Constants
- func DBIExists(txn *lmdb.Txn, dbiName string) (bool, error)
- func IsEmpty(txn *lmdb.Txn, dbi lmdb.DBI) (bool, error)
- func New(path string, flags uint) (*lmdb.Env, error)
- func NewWithOptions(path string, opt Options) (*lmdb.Env, error)
- func ReadDBINames(txn *lmdb.Txn) ([]string, error)
- func TestEnv(f TestEnvFunc) error
- func TestTxn(f TestTxnFunc) error
- type KV
- type KVString
- type Options
- type TestEnvFunc
- type TestTxnFunc
Constants ¶
const ( DefaultDirMask = 0775 DefaultFileMask = 0664 DefaultMapSize = 1 * datasize.GB DefaultMaxDBs = 64 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates an LMDB Env suitable for generating a filter platform production LMDB test database. The returned env must be closed after use.
func NewWithOptions ¶
NewWithOptions creates an LMDB Env suitable for generating a filter platform production LMDB test database using given options. The returned env must be closed after use.
func ReadDBINames ¶
ReadDBINames reads all DBI names from the root database
func TestEnv ¶
func TestEnv(f TestEnvFunc) error
TestEnv creates a temporary LMDB database and calls the given test function with the temporary LMDB Env. Any error returned by this function is returned unmodified to the caller.
func TestTxn ¶
func TestTxn(f TestTxnFunc) error
TestTxn creates a temporary LMDB database and calls the given test function with a write transaction and a new DBI that will be rolled back on return. This is a convenience wrapper around TestEnv(). Any error returned by this function is returned unmodified to the caller.
Types ¶
type Options ¶
type Options struct {
DirMask os.FileMode `yaml:"dir_mask"`
FileMask os.FileMode `yaml:"file_mask"`
MapSize datasize.ByteSize `yaml:"map_size"`
MaxDBs int `yaml:"max_dbs"`
NoSubdir bool `yaml:"no_subdir"`
Create bool `yaml:"create"`
EnvFlags uint `yaml:"-"` // Too dangerous for direct yaml support
}
Options are used for NewWithOptions, allowing a user to override them This type is also used for the yaml config file.
func (Options) WithDefaults ¶
WithDefaults returns new Options with defaults set for values that were not set
type TestEnvFunc ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package stats implements a Prometheus Collector for LMDBs
|
Package stats implements a Prometheus Collector for LMDBs |
|
Package strategy implements various LMDB data insert strategies.
|
Package strategy implements various LMDB data insert strategies. |