database

package
v0.0.0-...-349195c Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKey

func GetKey(bucket string, key []byte) (CKey []byte)

GetKey Given a bucket and a key, return the combined key

Types

type DB

type DB struct {
	DBHome string
	// contains filtered or unexported fields
}

func (*DB) Get

func (d *DB) Get(bucket string, key []byte) (value []byte)

Get Look in the given bucket, and return the key found. Returns nil if no value is found for the given key

func (*DB) GetInt32

func (d *DB) GetInt32(bucket string, ikey uint32) (value []byte)

func (*DB) Init

func (d *DB) Init(instance int)

We take an instance of the database, because we anticipate sometime in the future, running multiple instances of the database. This feature might not ever be used for the ValAcc project, but it has been useful for factomd testing.

func (*DB) Put

func (d *DB) Put(bucket string, key []byte, value []byte) error

Put Put a key/value in the database. We return an error if there was a problem writing the key/value pair to the database.

func (*DB) PutInt32

func (d *DB) PutInt32(bucket string, ikey int, value []byte) error

PutInt Put a key/value in the database, where the key is an index. We return an error if there was a problem writing the key/value pair to the database.

Jump to

Keyboard shortcuts

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