Documentation
¶
Index ¶
- Variables
- type Database
- type Object
- func AddDataObj(db *Database, prefix byte, key []byte, val []byte) (Object, error)
- func DelDataObj(db *Database, prefix byte) (Object, error)
- func GetDataObj(db *Database, prefix byte, key []byte, val []byte, stopAfterFirstRow ...bool) (Object, error)
- func SetDataObj(db *Database, prefix byte, key []byte, val []byte) (Object, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugMode = false
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
File *os.File
Path string
BitSize uint16
PrefixList []byte
MU sync.Mutex
// contains filtered or unexported fields
}
func Open ¶
Open opens an existing database or creates a new one
@bitSize tells the database what bit size to use (this value must always be consistent)
- (default: 128)
- (0 = default 128)
- (min = 64)
- (max = 64000)
note: in debug mode, (min = 16)
@prefixList tells the database what additional characters to preserve for the database object prefixes
type Object ¶
func AddDataObj ¶
AddDataObj adds a new key value pair to the database, given a prefix
note: this method also runs `File.Seek(0, io.SeekStart)`
func DelDataObj ¶
DelDataObj removes a key value pair from the database, given a prefix
Click to show internal directories.
Click to hide internal directories.