account

package
Version: v0.0.0-...-6a9f9bf Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(h *Holdings) error

Process processes new account holdings updates

func SubscribeToExchangeAccount

func SubscribeToExchangeAccount(exchange string) (dispatch.Pipe, error)

SubscribeToExchangeAccount subcribes to your exchange account

Types

type Account

type Account struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

Account holds a stream ID and a pointer to the exchange holdings

type Balance

type Balance struct {
	CurrencyName currency.Code
	TotalValue   float64
	Hold         float64
}

Balance is a sub type to store currency name and individual totals

type Holdings

type Holdings struct {
	Exchange string
	Accounts []SubAccount
}

Holdings is a generic type to hold each exchange's holdings for all enabled currencies

func GetHoldings

func GetHoldings(exch string) (Holdings, error)

GetHoldings returns full holdings for an exchange

type Service

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Service holds ticker information for each individual exchange

func (*Service) Update

func (s *Service) Update(a *Holdings) error

Update updates holdings with new account info

type SubAccount

type SubAccount struct {
	ID         string
	Currencies []Balance
}

SubAccount defines a singular account type with asocciated currency balances

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL