Documentation
¶
Index ¶
- Constants
- Variables
- func Version() string
- type Cursor
- func (cursor *Cursor) Close() error
- func (cursor *Cursor) Count() (uint64, error)
- func (cursor *Cursor) DBI() DBI
- func (cursor *Cursor) Del(flags uint) error
- func (cursor *Cursor) Get(set_key []byte, op uint) (key, val []byte, err error)
- func (cursor *Cursor) GetGo(set_key interface{}, op uint, key, val interface{}) error
- func (cursor *Cursor) MdbCursor() *C.MDB_cursor
- func (cursor *Cursor) Put(key, val []byte, flags uint) error
- func (cursor *Cursor) PutGo(key, val interface{}, flags uint) error
- func (cursor *Cursor) Txn() *Txn
- type DBI
- type Env
- func (env *Env) BeginTxn(parent *Txn, flags uint) (*Txn, error)
- func (env *Env) Close() error
- func (env *Env) Copy(path string) error
- func (env *Env) DBIClose(dbi DBI)
- func (env *Env) Flags() (uint, error)
- func (env *Env) Info() (*Info, error)
- func (env *Env) Open(path string, flags uint, mode uint) error
- func (env *Env) Path() (string, error)
- func (env *Env) SetFlags(flags uint, onoff int) error
- func (env *Env) SetMapSize(size uint64) error
- func (env *Env) SetMaxDBs(size DBI) error
- func (env *Env) SetMaxReaders(size uint) error
- func (env *Env) Stat() (*Stat, error)
- func (env *Env) Sync(force int) error
- type Errno
- type Info
- type Stat
- type Txn
- func (txn *Txn) Abort()
- func (txn *Txn) Commit() error
- func (txn *Txn) CursorOpen(dbi DBI) (*Cursor, error)
- func (txn *Txn) CursorRenew(cursor *Cursor) error
- func (txn *Txn) DBIOpen(name *string, flags uint) (DBI, error)
- func (txn *Txn) Del(dbi DBI, key, val []byte) error
- func (txn *Txn) DelGo(dbi DBI, key, val interface{}) error
- func (txn *Txn) Drop(dbi DBI, del int) error
- func (txn *Txn) Get(dbi DBI, key []byte) ([]byte, error)
- func (txn *Txn) GetGo(dbi DBI, key, val interface{}) error
- func (txn *Txn) Put(dbi DBI, key []byte, val []byte, flags uint) error
- func (txn *Txn) PutGo(dbi DBI, key, val interface{}, flags uint) error
- func (txn *Txn) Renew() error
- func (txn *Txn) Reset()
- func (txn *Txn) Stat(dbi DBI) (*Stat, error)
Constants ¶
View Source
const ( FIRST = iota FIRST_DUP GET_BOTH GET_RANGE GET_CURRENT GET_MULTIPLE LAST LAST_DUP NEXT NEXT_DUP NEXT_MULTIPLE NEXT_NODUP PREV PREV_DUP PREV_NODUP SET SET_KEY SET_RANGE )
MDB_cursor_op
View Source
const ( FIXEDMAP = C.MDB_FIXEDMAP // mmap at a fixed address (experimental) NOSUBDIR = C.MDB_NOSUBDIR // no environment directory NOSYNC = C.MDB_NOSYNC // don't fsync after commit RDONLY = C.MDB_RDONLY // read only NOMETASYNC = C.MDB_NOMETASYNC // don't fsync metapage after commit WRITEMAP = C.MDB_WRITEMAP // use writable mmap MAPASYNC = C.MDB_MAPASYNC // use asynchronous msync when MDB_WRITEMAP is use NOTLS = C.MDB_NOTLS // tie reader locktable slots to Txn objects instead of threads )
mdb_env Environment Flags
View Source
const ( REVERSEKEY = C.MDB_REVERSEKEY // use reverse string keys DUPSORT = C.MDB_DUPSORT // use sorted duplicates INTEGERKEY = C.MDB_INTEGERKEY // numeric keys in native byte order. The keys must all be of the same size. DUPFIXED = C.MDB_DUPFIXED // with DUPSORT, sorted dup items have fixed size INTEGERDUP = C.MDB_INTEGERDUP // with DUPSORT, dups are numeric in native byte order REVERSEDUP = C.MDB_REVERSEDUP // with DUPSORT, use reverse string dups CREATE = C.MDB_CREATE // create DB if not already existing )
DBIOpen Database Flags
View Source
const ( NODUPDATA = C.MDB_NODUPDATA NOOVERWRITE = C.MDB_NOOVERWRITE RESERVE = C.MDB_RESERVE APPEND = C.MDB_APPEND APPENDDUP = C.MDB_APPENDDUP )
put flags
View Source
const (
SUCCESS = 0
)
Variables ¶
View Source
var ( KeyExist error = Errno(-30799) NotFound error = Errno(-30798) PageNotFound error = Errno(-30797) Corrupted error = Errno(-30796) Panic error = Errno(-30795) VersionMismatch error = Errno(-30794) Invalid error = Errno(-30793) MapFull error = Errno(-30792) DbsFull error = Errno(-30791) ReadersFull error = Errno(-30790) TlsFull error = Errno(-30789) TxnFull error = Errno(-30788) CursorFull error = Errno(-30787) PageFull error = Errno(-30786) MapResized error = Errno(-30785) Incompatibile error = Errno(-30784) )
error codes
Functions ¶
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
func (*Cursor) MdbCursor ¶
func (cursor *Cursor) MdbCursor() *C.MDB_cursor
Retrieves the low-level MDB cursor.
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env is opaque structure for a database environment. A DB environment supports multiple databases, all residing in the same shared-memory map.
func (*Env) Open ¶
Open an environment handle. If this function fails Close() must be called to discard the Env handle.
func (*Env) SetMapSize ¶
func (*Env) SetMaxReaders ¶
type Info ¶
type Info struct { MapSize uint64 // Size of the data memory map LastPNO uint64 // ID of the last used page LastTxnID uint64 // ID of the last committed transaction MaxReaders uint // maximum number of threads for the environment NumReaders uint // maximum number of threads used in the environment }
type Stat ¶
type Stat struct { PSize uint // Size of a database page. This is currently the same for all databases. Depth uint // Depth (height) of the B-tree BranchPages uint64 // Number of internal (non-leaf) pages LeafPages uint64 // Number of leaf pages OwerflowPages uint64 // Number of overflow pages Entries uint64 // Number of data items }
Statistics for a database in the environment
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn is Opaque structure for a transaction handle. All database operations require a transaction handle. Transactions may be read-only or read-write.
func (*Txn) CursorRenew ¶
Click to show internal directories.
Click to hide internal directories.