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: 0

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