db

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTransaction     = errors.New("no transaction")
	ErrNestedTransaction = errors.New("nested transaction not supported")
	ErrTransactionExist  = errors.New("close transaction first")
)

Functions

func Begin added in v0.0.2

func Begin(_writable bool) (*buntdb.Tx, error)

func Close

func Close() error

func Commit added in v0.0.2

func Commit() error

func GetClient

func GetClient() (*buntdb.DB, error)

func GetCurrentOrNewTransaction added in v0.0.3

func GetCurrentOrNewTransaction() (*buntdb.Tx, bool, func() error)

GetCurrentOrNewTransaction return current transaction, or create new one if no transaction, make sure the func is called.

func GetCurrentTransaction added in v0.0.2

func GetCurrentTransaction() (*buntdb.Tx, bool)

GetCurrentTransaction return current transaction, return nil if no current transaction

func GetDbPath

func GetDbPath() string

func GetTempDbPath

func GetTempDbPath(prefix string) string

func InitBuntDB

func InitBuntDB(filename string) error

func RWDescribe added in v0.0.2

func RWDescribe(writable bool) string

func Rollback added in v0.0.2

func Rollback() error

func Save added in v0.0.3

func Save(writer io.Writer) error

func Shrink added in v0.0.3

func Shrink() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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