middleware

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

Documentation

Index

Constants

View Source
const (
	R_READ_WALLETS  = "ReadWallets"
	R_CREATE_WALLET = "CreateWallet"
	R_READ_WALLET   = "ReadWallet"
	R_UPDATE_WALLET = "UpdateWallet"
	R_DELETE_WALLET = "DeleteWallet"
	R_READ_FUND     = "ReadFund"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Endpoint string
	// contains filtered or unexported fields
}

API helps to communicate with the backend

func NewAPI

func NewAPI(endpoint string) *API

func (*API) CreateWallet

func (api *API) CreateWallet(walletName string) (models.Wallet, error)

func (*API) DeleteWallet

func (api *API) DeleteWallet(wallet models.Wallet) error

func (*API) GetFund

func (api *API) GetFund(insi string) (models.FundData, error)

func (*API) GetWallets

func (api *API) GetWallets() ([]models.Wallet, error)

GetWallets get all wallets

func (*API) UpdateWallet

func (api *API) UpdateWallet(wallet models.Wallet) error

type APIRef

type APIRef struct{ *API }

func (*APIRef) APISet

func (cr *APIRef) APISet(c *API)

type APISetter

type APISetter interface {
	APISet(*API)
}

type Loader

type Loader struct {
	S *State
	A *API
}

Loader helps to communicate with the backend

func NewLoader

func NewLoader(st *State, api *API) *Loader

NewLoader returns a new loader. This needs the API and State

func (*Loader) UpdateFundData

func (lo *Loader) UpdateFundData(activeWallet *models.Wallet, insi string) error

func (*Loader) UpdateFundsData

func (lo *Loader) UpdateFundsData(activeWallet *models.Wallet) error

UpdateFundsData update all FundData for the whole wallet

type LoaderRef

type LoaderRef struct{ *Loader }

func (*LoaderRef) LoaderSet

func (cr *LoaderRef) LoaderSet(c *Loader)

type LoaderSetter

type LoaderSetter interface {
	LoaderSet(*Loader)
}

type State

type State struct {
	S map[string]interface{} `vugu:"data"`
}

State web application store

func NewState

func NewState() *State

NewState returns a new State store

func (*State) Get

func (st *State) Get(key string) (interface{}, error)

Get a value from the store

func (*State) Set

func (st *State) Set(key string, value interface{}) error

Set a value in the store

func (*State) Unset

func (st *State) Unset(key string)

Unset removes a value from the store

type StateRef

type StateRef struct{ *State }

func (*StateRef) StateSet

func (cr *StateRef) StateSet(c *State)

type StateSetter

type StateSetter interface {
	StateSet(*State)
}

Jump to

Keyboard shortcuts

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