berkeleydb

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2023 License: LGPL-3.0 Imports: 3 Imported by: 0

README

go-berkeleydb

GoDoc

This library allow usage of berkeley db. Note all functions are not implemented, check the API documentation to get more information.

build

This package is tested on Linux rhel-like, debian-like and macos. Its a wrapper on C library.

  • For rhel-like: dnf install libdb-devel
  • For macos: brew install berkeley-db

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BDB

type BDB struct {
	// contains filtered or unexported fields
}

func Open

func Open(file string) *BDB

Open DB file. Return nil if an error occurs

func (*BDB) Close

func (bdb *BDB) Close()

Close DB handle

func (*BDB) Get

func (bdb *BDB) Get(key string) (string, Status)

Get key in the DB, return BDB_OK on suces, otherwise check Status documentation

type Status

type Status int

operation status

const (
	BDB_OK         Status = C.BDB_OK         // Its alright
	BDB_NOT_EXISTS Status = C.BDB_NOT_EXISTS // DB does not exists or do not have access
	BDB_TEMP_ERROR Status = C.BDB_TEMP_ERROR // Temporary error
	BDB_ERROR      Status = C.BDB_ERROR      // Unrecoverable error
	BDB_FORMAT     Status = C.BDB_FORMAT     // Do not reconize the database format
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL