postgres

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New(logger log.Logger, client postgres.Client) *Database

func (*Database) Ping

func (db *Database) Ping(ctx context.Context) error

func (*Database) Wallets

func (db *Database) Wallets(storeID string) database.Wallets

type Wallets

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

func NewWallets

func NewWallets(storeID string, db postgres.Client, logger log.Logger) *Wallets

func (*Wallets) Add

func (ea *Wallets) Add(ctx context.Context, account *entities.Wallet) (*entities.Wallet, error)

func (*Wallets) Delete

func (ea *Wallets) Delete(ctx context.Context, pubkey string) error

func (*Wallets) Get

func (ea *Wallets) Get(ctx context.Context, pubkey string) (*entities.Wallet, error)

func (*Wallets) GetAll

func (ea *Wallets) GetAll(ctx context.Context) ([]*entities.Wallet, error)

func (*Wallets) GetAllDeleted

func (ea *Wallets) GetAllDeleted(ctx context.Context) ([]*entities.Wallet, error)

func (*Wallets) GetDeleted

func (ea *Wallets) GetDeleted(ctx context.Context, pubkey string) (*entities.Wallet, error)

func (*Wallets) Purge

func (ea *Wallets) Purge(ctx context.Context, pubkey string) error

func (*Wallets) Restore

func (ea *Wallets) Restore(ctx context.Context, pubkey string) error

func (*Wallets) RunInTransaction

func (ea *Wallets) RunInTransaction(ctx context.Context, persist func(dbTx database.Wallets) error) error

func (*Wallets) SearchAddresses

func (ea *Wallets) SearchAddresses(ctx context.Context, isDeleted bool, limit, offset uint64) ([]string, error)

func (*Wallets) Update

func (ea *Wallets) Update(ctx context.Context, account *entities.Wallet) (*entities.Wallet, error)

Jump to

Keyboard shortcuts

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