db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	*bolt.DB
}

Database stores database connection.

func NewDB

func NewDB(opt *DatabaseOptions) (d *Database, err error)

NewDB will create a new database connection.

func (*Database) Init

func (db *Database) Init() (err error)

Init will init current database.

type DatabaseOptions

type DatabaseOptions struct {
	Address string
}

DatabaseOptions stores database options.

type Tx

type Tx = bolt.Tx

Tx represents a read-only or read/write transaction on the database. Read-only transactions can be used for retrieving values for keys and creating cursors. Read/write transactions can create and remove buckets and create and remove keys.

IMPORTANT: You must commit or rollback transactions when you are done with them. Pages can not be reclaimed by the writer until no more transactions are using them. A long running read transaction can cause the database to quickly grow.

Jump to

Keyboard shortcuts

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