lite

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BidEncodingSize = 72

BidEncodingSize is the expected size of the serialized encoding of the bid.

View Source
var DriverName = "lite_v0.1.0"

DriverName is the unique identifier for the lite driver.

Functions

func CreateDBConnection

func CreateDBConnection() (database.Driver, database.DB)

CreateDBConnection creates a connection to the DB.

func NewDatabase

func NewDatabase(path string, network protocol.Magic, readonly bool) (database.DB, error)

NewDatabase returns a DB instance. This should be the ideal situation with lowest latency on storing or fetching data. In-memory only (as result autoDeleted). multi-instances (no singleton).

Types

type DB

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

DB represents the db struct.

func (*DB) Begin

func (db *DB) Begin(writable bool) (database.Transaction, error)

Begin builds read-only or read-write Transaction.

func (*DB) Close

func (db *DB) Close() error

Close is actually a dummy method on a lite driver.

func (*DB) Update

func (db *DB) Update(fn func(database.Transaction) error) error

Update the DB within a transaction.

func (*DB) View

func (db *DB) View(fn func(database.Transaction) error) error

View performs the equivalent of a Select SQL statement.

Jump to

Keyboard shortcuts

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