account

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountName string  `json:"account_name"`
	AccountUuid string  `json:"account_uuid"`
	Wad         wad.Wad `json:"wad"`
	// pending TODO
	SharedSeeds []beacon.SharedSeed `json:"shared_seeds"`
	Beacons     []beacon.Beacon     `json:"beacons"`
}

represents a terminus account

func AdbFromFile

func AdbFromFile(filename string) (adb Account, err error)

read an account db out of a file

func (*Account) AddBeacon

func (a *Account) AddBeacon(newBeacon beacon.Beacon)

func (*Account) AddSharedSeed

func (a *Account) AddSharedSeed(ss beacon.SharedSeed)

func (*Account) MarshalJSON

func (a *Account) MarshalJSON() ([]byte, error)

func (*Account) Payee

func (a *Account) Payee() bool

wether or not account is payee, always true in terminus

func (*Account) Payer

func (a *Account) Payer() bool

wether or not account is payer, always true in terminus

func (*Account) Ready

func (a *Account) Ready() bool

func (*Account) RemoveBeacon

func (a *Account) RemoveBeacon(toRemove beacon.Beacon)

func (*Account) RemoveSharedSeed

func (a *Account) RemoveSharedSeed(ss beacon.SharedSeed)

func (*Account) UnmarshalJSON

func (a *Account) UnmarshalJSON(b []byte) (err error)

type AccountDb

type AccountDb struct {
	Details Account

	// map of beacon string to most recent error when trying to connect
	ConnectionAttempts map[string]error
	// contains filtered or unexported fields
}

represents the data store for a single account

func GetAccountDbs

func GetAccountDbs(configuration *config.Config) (adList []AccountDb)

get a list of accoutdbs from our config file in python this is an iter, but I can only assume we're not using this for a large number of accounts (hopefully)

func GetPersistedAccounts

func GetPersistedAccounts(config *config.Config) (accts []AccountDb)

func NewAccountDb

func NewAccountDb(accountName string, config *config.Config) (adb AccountDb)

func (*AccountDb) AddConnectionAttempt

func (a *AccountDb) AddConnectionAttempt(attemptedBeacon beacon.Beacon, err error)

add a connection attempt for the current account

func (AccountDb) Depersist

func (a AccountDb) Depersist() error

func (*AccountDb) GetDisconnectedBeacons added in v0.17.0

func (a *AccountDb) GetDisconnectedBeacons() (beacons []beacon.Beacon)

get array of beacons which have disconnected

func (AccountDb) GetSummaryString

func (a AccountDb) GetSummaryString(locations []location.Location) (summaryStr string)

func (AccountDb) Persist

func (a AccountDb) Persist() error

Jump to

Keyboard shortcuts

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