leveldb

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package leveldb provides some useful functions to work with LevelDB. It has common database functions as OpenDB, CloseDB, Insert and Iterate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB(db *leveldb.DB)

CloseDB is a function that receives a DB pointer that closes the connection to DB.

func GetBfTx

func GetBfTx(id string) (bf_tx.BF_TX, error)

GetBfTx is a function that receives a bf_tx id, and returns the BF_TX if it exists.

func InsertBFTX added in v0.5.0

func InsertBFTX(key string, value string, db *leveldb.DB) error

InsertBFTX is a function that receives the key and value strings to insert a tuple in determined DB, the final parameter. As result, it returns a true or false bool.

func OpenDB

func OpenDB(dbPath string) (db *leveldb.DB, err error)

OpenDB is a function that receives the path of the DB, creates or opens that DB and return ir with a possible error if that occurred.

func RecordOnDB

func RecordOnDB(id string, json string) error

RecordOnDB is a function that receives the content of the BF_RX JSON to insert it into the DB and return true or false according to the result.

func Total

func Total() (int, error)

Total is a function that returns the total of BF_TX stored in the DB.

func Verify

func Verify(jcontent string) ([]byte, error)

Verify is a function that receives a content and look for a BF_TX that has the same content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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