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(name string) error
- func (handle *Db) Flags() (C.u_int32_t, error)
- func (handle *Db) Get(name string) (string, error)
- func (handle *Db) Open(filename 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(name, value string) 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.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor holds the current cursor position
func (*Cursor) GetFirst ¶
GetFirst moves the cursor to the first entry and returns the key/value pair
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.