tokyocabinet

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: LGPL-2.1 Imports: 5 Imported by: 0

README

GoDoc Build Status

Go bindings for (most of) the Tokyo Cabinet database library.

Copyright 2014 ThreatGRID, Inc.

Included are API mappings for the abstract (ADB), hash (HDB), B+ (BDB), and fixed-size (FDB) modules of Tokyo Cabinet. TDB is not mapped at this time.

The newer Kyoto Cabinet library has separately maintained Go bindings by a different author. If your software is compatible with the GPLv3 license, you should use it instead; see http://bitbucket.org/ww/cabinet

Please see the upstream Tokyo Cabinet API documentation for usage.

Documentation

Index

Constants

View Source
const BDBFFATAL int = C.BDBFFATAL
View Source
const BDBFOPEN int = C.BDBFOPEN
View Source
const BDBOCREAT int = C.BDBOCREAT
View Source
const BDBOLCKNB int = C.BDBOLCKNB
View Source
const BDBONOLCK int = C.BDBONOLCK
View Source
const BDBOREADER int = C.BDBOREADER
View Source
const BDBOTRUNC int = C.BDBOTRUNC
View Source
const BDBOWRITER int = C.BDBOWRITER
View Source
const BDBTBZIP int = C.BDBTBZIP
View Source
const BDBTDEFLATE int = C.BDBTLARGE
View Source
const BDBTEXCODEC int = C.BDBTEXCODEC
View Source
const BDBTLARGE int = C.BDBTLARGE
View Source
const BDBTTCBS int = C.BDBTTCBS
View Source
const ERR_MSG string = "Database operation failed"

Abstract Database Object doesn't provide detailed error messages.

View Source
const FDBFFATAL int = C.FDBFFATAL
View Source
const FDBFOPEN int = C.FDBFOPEN
View Source
const FDBOCREAT int = C.FDBOCREAT
View Source
const FDBOLCKNB int = C.FDBOLCKNB
View Source
const FDBONOLCK int = C.FDBONOLCK
View Source
const FDBOREADER int = C.FDBOREADER
View Source
const FDBOTRUNC int = C.FDBOTRUNC
View Source
const FDBOWRITER int = C.FDBOWRITER
View Source
const HDBFFATAL int = C.HDBFFATAL
View Source
const HDBFOPEN int = C.HDBFOPEN
View Source
const HDBOCREAT int = C.HDBOCREAT
View Source
const HDBOLCKNB int = C.HDBOLCKNB
View Source
const HDBONOLCK int = C.HDBONOLCK
View Source
const HDBOREADER int = C.HDBOREADER
View Source
const HDBOTRUNC int = C.HDBOTRUNC
View Source
const HDBOWRITER int = C.HDBOWRITER
View Source
const HDBTBZIP int = C.HDBTBZIP
View Source
const HDBTDEFLATE int = C.HDBTLARGE
View Source
const HDBTEXCODEC int = C.HDBTEXCODEC
View Source
const HDBTLARGE int = C.HDBTLARGE
View Source
const HDBTTCBS int = C.HDBTTCBS
View Source
const TCDBTBTREE int = C.TCDBTBTREE
View Source
const TCDBTFIXED int = C.TCDBTFIXED
View Source
const TCDBTHASH int = C.TCDBTHASH
View Source
const TCDBTTABLE int = C.TCDBTTABLE
View Source
const TCECLOSE int = C.TCECLOSE
View Source
const TCEKEEP int = C.TCEKEEP
View Source
const TCELOCK int = C.TCELOCK
View Source
const TCEMETA int = C.TCEMETA
View Source
const TCEMISC int = C.TCEMISC
View Source
const TCEMKDIR int = C.TCEMKDIR
View Source
const TCEMMAP int = C.TCEMMAP
View Source
const TCENOFILE int = C.TCENOFILE
View Source
const TCENOPERM int = C.TCENOPERM
View Source
const TCENOREC int = C.TCENOREC
View Source
const TCEOPEN int = C.TCEOPEN
View Source
const TCEREAD int = C.TCEREAD
View Source
const TCERENAME int = C.TCERENAME
View Source
const TCERHEAD int = C.TCERHEAD
View Source
const TCERMDIR int = C.TCERMDIR
View Source
const TCESEEK int = C.TCESEEK
View Source
const TCESTAT int = C.TCESTAT
View Source
const TCESUCCESS int = C.TCESUCCESS
View Source
const TCESYNC int = C.TCESYNC
View Source
const TCETHREAD int = C.TCETHREAD
View Source
const TCETRUNC int = C.TCETRUNC
View Source
const TCEUNLINK int = C.TCEUNLINK
View Source
const TCEWRITE int = C.TCEWRITE
View Source
const TCINVALID int = C.TCEINVALID

Variables

This section is empty.

Functions

func ECodeName

func ECodeName(ecode int) string

func ECodeNameBDB

func ECodeNameBDB(ecode int) string

func ECodeNameFDB

func ECodeNameFDB(ecode int) string

func ECodeNameHDB

func ECodeNameHDB(ecode int) string

Types

type ADB

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

ADB represents an Abstract Database Object which supports all Tokyo Cabinet database types.

func NewADB

func NewADB() *ADB

NewADB returns a new Abstract Database Object.

func (*ADB) AbortTxn

func (db *ADB) AbortTxn() (err error)

func (*ADB) AddDouble

func (db *ADB) AddDouble(key []byte, value float64) (newvalue float64, err error)

func (*ADB) AddInt

func (db *ADB) AddInt(key []byte, value int) (newvalue int, err error)

func (*ADB) BeginTxn

func (db *ADB) BeginTxn() (err error)

func (*ADB) Close

func (db *ADB) Close() (err error)

Close will close the opened database

Note: Update of a database is assured to be written when the database is closed. If a writer opens a database but does not close it appropriately, the database will be broken.

func (*ADB) CommitTxn

func (db *ADB) CommitTxn() (err error)

func (*ADB) Del

func (db *ADB) Del()

Del is used to delete an Abstract Database Object.

func (*ADB) Get

func (db *ADB) Get(key []byte) (out []byte, err error)

func (*ADB) IterKeys

func (db *ADB) IterKeys() (c chan []byte, e chan error)

func (*ADB) IterKeysString added in v1.1.0

func (db *ADB) IterKeysString() ([]string, error)

IterKeysString is an IterKeys() helper method that returns a slice of iterated strings.

NOTE: returned []string can be in arbitrary order, see IterKeysStringSorted()

func (*ADB) IterKeysStringSorted added in v1.1.0

func (db *ADB) IterKeysStringSorted() ([]string, error)

IterKeysStringSorted is an IterKeys() helper method that returns a sorted slice of iterated strings.

func (*ADB) Open

func (db *ADB) Open(path string) (err error)

Open will open an existing database, or create a new one if it doesn't exist.

Note: The database that is opened and written to must be closed.

func (*ADB) Put

func (db *ADB) Put(key []byte, value []byte) (err error)

func (*ADB) PutCat

func (db *ADB) PutCat(key []byte, value []byte) (err error)

func (*ADB) PutKeep

func (db *ADB) PutKeep(key []byte, value []byte) (err error)

func (*ADB) Remove

func (db *ADB) Remove(key []byte) (err error)

func (*ADB) Size

func (db *ADB) Size(key []byte) (out int, err error)

func (*ADB) Sync

func (db *ADB) Sync() (err error)

type BDB

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

func NewBDB

func NewBDB() *BDB

func (*BDB) AbortTxn

func (db *BDB) AbortTxn() (err error)

func (*BDB) AddDouble

func (db *BDB) AddDouble(key []byte, value float64) (newvalue float64, err error)

func (*BDB) AddInt

func (db *BDB) AddInt(key []byte, value int) (newvalue int, err error)

func (*BDB) BeginTxn

func (db *BDB) BeginTxn() (err error)

func (*BDB) Close

func (db *BDB) Close() (err error)

func (*BDB) CommitTxn

func (db *BDB) CommitTxn() (err error)

func (*BDB) Del

func (db *BDB) Del()

func (*BDB) Get

func (db *BDB) Get(key []byte) (out []byte)

func (*BDB) LastECode

func (db *BDB) LastECode() int

func (*BDB) LastError

func (db *BDB) LastError() error

func (*BDB) Open

func (db *BDB) Open(path string, omode int) (err error)

func (*BDB) Put

func (db *BDB) Put(key []byte, value []byte) (err error)

func (*BDB) PutCat

func (db *BDB) PutCat(key []byte, value []byte) (err error)

func (*BDB) PutKeep

func (db *BDB) PutKeep(key []byte, value []byte) (err error)

func (*BDB) Range

func (db *BDB) Range(startKey []byte, startInclusive bool, endKey []byte,
	endInclusive bool, max int) (keys [][]byte, err error)

negative max for infinite

func (*BDB) Remove

func (db *BDB) Remove(key []byte) (err error)

func (*BDB) Size

func (db *BDB) Size(key []byte) (out int, err error)

func (*BDB) Sync

func (db *BDB) Sync() (err error)

type FDB

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

func NewFDB

func NewFDB() *FDB

func (*FDB) AbortTxn

func (db *FDB) AbortTxn() (err error)

func (*FDB) AddDouble

func (db *FDB) AddDouble(key int64, value float64) (newvalue float64, err error)

func (*FDB) AddInt

func (db *FDB) AddInt(key int64, value int) (newvalue int, err error)

func (*FDB) BeginTxn

func (db *FDB) BeginTxn() (err error)

func (*FDB) Close

func (db *FDB) Close() (err error)

func (*FDB) CommitTxn

func (db *FDB) CommitTxn() (err error)

func (*FDB) Del

func (db *FDB) Del()

func (*FDB) Get

func (db *FDB) Get(key int64) (out []byte, err error)

func (*FDB) IterKeys

func (db *FDB) IterKeys() (c chan int64, e chan error)

note that only one iterator can be active at a time for a given database

func (*FDB) LastECode

func (db *FDB) LastECode() int

func (*FDB) LastError

func (db *FDB) LastError() error

func (*FDB) Open

func (db *FDB) Open(path string, omode int) (err error)

func (*FDB) Put

func (db *FDB) Put(key int64, value []byte) (err error)

func (*FDB) PutCat

func (db *FDB) PutCat(key int64, value []byte) (err error)

func (*FDB) PutKeep

func (db *FDB) PutKeep(key int64, value []byte) (err error)

func (*FDB) Remove

func (db *FDB) Remove(key int64) (err error)

func (*FDB) Size

func (db *FDB) Size(key int64) (out int, err error)

func (*FDB) Sync

func (db *FDB) Sync() (err error)

type HDB

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

func NewHDB

func NewHDB() *HDB

func (*HDB) AbortTxn

func (db *HDB) AbortTxn() (err error)

func (*HDB) AddDouble

func (db *HDB) AddDouble(key []byte, value float64) (newvalue float64, err error)

func (*HDB) AddInt

func (db *HDB) AddInt(key []byte, value int) (newvalue int, err error)

func (*HDB) BeginTxn

func (db *HDB) BeginTxn() (err error)

func (*HDB) Close

func (db *HDB) Close() (err error)

func (*HDB) CommitTxn

func (db *HDB) CommitTxn() (err error)

func (*HDB) Del

func (db *HDB) Del()

func (*HDB) Get

func (db *HDB) Get(key []byte) (out []byte, err error)

func (*HDB) IterKeys

func (db *HDB) IterKeys() (c chan []byte, e chan error)

note that only one iterator can be active at a time for a given database

func (*HDB) LastECode

func (db *HDB) LastECode() int

func (*HDB) LastError

func (db *HDB) LastError() error

func (*HDB) Open

func (db *HDB) Open(path string, omode int) (err error)

func (*HDB) Put

func (db *HDB) Put(key []byte, value []byte) (err error)

func (*HDB) PutAsync

func (db *HDB) PutAsync(key []byte, value []byte) (err error)

func (*HDB) PutCat

func (db *HDB) PutCat(key []byte, value []byte) (err error)

func (*HDB) PutKeep

func (db *HDB) PutKeep(key []byte, value []byte) (err error)

func (*HDB) Remove

func (db *HDB) Remove(key []byte) (err error)

func (*HDB) SetCache

func (db *HDB) SetCache(rcnum int32) (err error)

func (*HDB) SetDefragStepSize

func (db *HDB) SetDefragStepSize(dfunit int32) (err error)

func (*HDB) SetExtraMemorySize

func (db *HDB) SetExtraMemorySize(xmsiz int64) (err error)

func (*HDB) Size

func (db *HDB) Size(key []byte) (out int, err error)

func (*HDB) Sync

func (db *HDB) Sync() (err error)

func (*HDB) Tune

func (db *HDB) Tune(bnum int64, apow int8, fpow int8, opts uint8) (err error)

type TokyoCabinetError

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

func NewTokyoCabinetError

func NewTokyoCabinetError(code int, msg string) *TokyoCabinetError

func (TokyoCabinetError) Error

func (e TokyoCabinetError) Error() string

Jump to

Keyboard shortcuts

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