account

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 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 is the name of the account
	AccountName string `json:"account_name"`
	// AccountUUID is the uuid for the account
	AccountUUID string `json:"account_uuid"`
	// Wad is the wad used by the account
	Wad wad.Wad `json:"wad"`
	// SharedSeeds is a list of shared seeds nicluded with the account
	SharedSeeds []beacon.SharedSeed `json:"shared_seeds"`
	// Beacons is a list of beacons associated with the account
	Beacons []beacon.Beacon `json:"beacons"`
}

Account represents a terminus account.

func AdbFromFile

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

AdbFromFile reads an account db out of a file.

func (*Account) AddBeacon

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

AddBeacon adds a beacon to the account.

func (*Account) AddSharedSeed

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

AddSharedSeed adds a shared seed from the account.

func (*Account) MarshalJSON

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

MarshalJSON encodes an Account as a json payload.

func (*Account) Payee

func (a *Account) Payee() bool

Payee is whether or not account is payee, always true in terminus.

func (*Account) Payer

func (a *Account) Payer() bool

Payer is whether or not account is payer, always true in terminus.

func (*Account) Ready

func (a *Account) Ready() bool

Ready determines if an account is ready for use. Right now this always returns true since the account's only use files right now.

func (*Account) RemoveBeacon

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

RemoveBeacon removes a beacon from the Account.

func (*Account) RemoveSharedSeed

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

RemoveSharedSeed removes a shared seed from the account.

func (*Account) UnmarshalJSON

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

UnmarshalJSON decodes an account from a json payload.

type DB added in v0.63.0

type DB struct {
	Details Account

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

DB represents the data store for a single account.

func GetAccountDbs

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

GetAccountDbs 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 []DB)

GetPersistedAccounts gets a list of accounts from a file DB.

func NewAccountDb

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

NewAccountDb creates an account db from a name/config.

func (*DB) AddConnectionAttempt added in v0.63.0

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

AddConnectionAttempt adds a connection attempt to the current account.

func (DB) DePersist added in v0.63.0

func (a DB) DePersist() error

DePersist removes an account from the database.

func (*DB) GetDisconnectedBeacons added in v0.63.0

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

GetDisconnectedBeacons gets an array of beacons which have disconnected.

func (DB) GetSummaryString added in v0.63.0

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

GetSummaryString gets a list of all beacons/locations/etc in the database.

func (DB) Persist added in v0.63.0

func (a DB) Persist() error

Persist saves an account to the database.

Jump to

Keyboard shortcuts

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