Documentation
¶
Index ¶
- Constants
- func Version() string
- type Cursor
- type DBError
- type Db
- func (handle *Db) Close() error
- func (handle *Db) Cursor() (*Cursor, error)
- func (handle *Db) Delete(key []byte) error
- func (handle *Db) Flags() (C.u_int32_t, error)
- func (handle *Db) Get(key []byte) ([]byte, error)
- func (handle *Db) Open(filename, dbname string, dbtype C.DBTYPE, flags C.u_int32_t) error
- func (handle *Db) OpenWithTxn(filename string, txn *C.DB_TXN, dbtype C.DBTYPE, flags C.u_int32_t) error
- func (handle *Db) Put(key, value []byte) error
- func (handle *Db) Remove(filename string) error
- func (handle *Db) Rename(oldname, newname string) error
- type Environment
- type Errno
Constants ¶
View Source
const ( DbCreate = C.DB_CREATE DbExcl = C.DB_EXCL DbRdOnly = C.DB_RDONLY DbTruncate = C.DB_TRUNCATE // DbInitMpool is used in environment only DbInitMpool = C.DB_INIT_MPOOL )
Flags for opening a database or environment.
View Source
const ( DbBtree = C.DB_BTREE DbHash = C.DB_HASH DbRecno = C.DB_RECNO DbQueue = C.DB_QUEUE DbUnknown = C.DB_UNKNOWN )
Database types.
View Source
const ( CrsFirst = C.DB_FIRST CrsNext = C.DB_NEXT CrsPrev = C.DB_PREV CrsLast = C.DB_LAST )
Cursor modes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor holds the current cursor position
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db is the structure that holds the database connection
func NewDBInEnvironment ¶
func NewDBInEnvironment(env *Environment) (*Db, error)
NewDBInEnvironment initialises a new bdb connection in an environment
func (*Db) OpenWithTxn ¶
func (handle *Db) OpenWithTxn(filename string, txn *C.DB_TXN, dbtype C.DBTYPE, flags C.u_int32_t) error
OpenWithTxn opens the database in transaction mode (transactions are not yet supported by all funtions)
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment holds the database environment
func NewEnvironment ¶
func NewEnvironment() (*Environment, error)
NewEnvironment creates a new database environment
func (*Environment) Close ¶
func (env *Environment) Close() error
Close a database in the environment
Click to show internal directories.
Click to hide internal directories.