persistence

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MainBucket is the bucket where the whole thing will be stored
	MainBucket = "Wallets"

	// DB is the key used for storing the datatore in the request context
	DB = "db"
)

Variables

This section is empty.

Functions

func Persistence

func Persistence(db *Database) echo.MiddlewareFunc

Persistence is the middleware handler for the persistence datastore

Types

type Database

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

Database is the main datastore implementation

func NewDatabase

func NewDatabase(path string) (*Database, error)

NewDatabase creates a new database object.

func (*Database) Close

func (db *Database) Close()

Close closes the database

func (*Database) DeleteWallet

func (db *Database) DeleteWallet(walletID string) error

func (*Database) GetWallet

func (db *Database) GetWallet(key string) (wlts []models.Wallet, err error)

func (*Database) SetWallet

func (db *Database) SetWallet(wallet models.Wallet) error

SetWallet keeps a wallet into database

func (*Database) UpdateWallet

func (db *Database) UpdateWallet(walletID string, newWallet models.Wallet) error

Jump to

Keyboard shortcuts

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