Documentation
¶
Index ¶
- func Register(name string, provider Provider)
- type Account
- type CommonElements
- type Config
- type ConvertSymbolPricingProvider
- type Existence
- type FallBackPricingProvider
- type Holding
- type Holdings
- func (h *Holdings) AddHolding(hh Holding)
- func (h *Holdings) AddHoldings(hh Holdings)
- func (h Holdings) FilterTokens(by string, rexes ...*regexp.Regexp) (final Holdings)
- func (h Holdings) HasCurrencyMap(left func(l IHolding) string, right func(r IHolding) string, ih ...IHolding) map[string]CommonElements
- func (h Holdings) HasCurrencyName(name string) bool
- func (h Holdings) HasCurrencySymbolName(symbol string) bool
- func (h Holdings) MapReduce() (final Holdings)
- func (h Holdings) SearchByPattern(pattern regexp.Regexp) []int
- type IHolding
- type IProvider
- type Price
- type Provider
- type ProviderIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account interface { IProvider // GetHoldings returns all holdings that is has GetHoldings() (Holdings, error) }
Account Interface to providing holding across different third party accounts
type CommonElements ¶
CommonElements contains positioning information about holdings in two lists
func (CommonElements) FoundBoth ¶
func (hi CommonElements) FoundBoth() bool
FoundBoth when both are not -1
func (CommonElements) LeftOnly ¶
func (hi CommonElements) LeftOnly() bool
LeftOnly when holding found in the Left List or the origination list
func (CommonElements) Result ¶
func (hi CommonElements) Result() Existence
Result returns a enum result of what is the account status across the two lists
func (CommonElements) RightOnly ¶
func (hi CommonElements) RightOnly() bool
RightOnly when holding found in the Right List or the target list
type ConvertSymbolPricingProvider ¶
func (*ConvertSymbolPricingProvider) GetExchange ¶
func (c *ConvertSymbolPricingProvider) GetExchange(currency1, currency2 string) (res string, err error)
func (*ConvertSymbolPricingProvider) Name ¶
func (c *ConvertSymbolPricingProvider) Name() string
type FallBackPricingProvider ¶
type FallBackPricingProvider struct {
Pricing []Price
}
func (*FallBackPricingProvider) GetExchange ¶
func (f *FallBackPricingProvider) GetExchange(currency1, currency2 string) (res string, err error)
func (*FallBackPricingProvider) Name ¶
func (f *FallBackPricingProvider) Name() string
type Holding ¶
func (Holding) CurrencyName ¶
func (Holding) CurrencySymbolName ¶
func (Holding) TotalSharesString ¶
type Holdings ¶
type Holdings []Holding
func (*Holdings) AddHolding ¶
func (*Holdings) AddHoldings ¶
func (Holdings) FilterTokens ¶ added in v0.3.1
FilterTokens by the provided regular expressions
func (Holdings) HasCurrencyMap ¶
func (h Holdings) HasCurrencyMap(left func(l IHolding) string, right func(r IHolding) string, ih ...IHolding) map[string]CommonElements
HasCurrencyMap compares holdings with another Holdings account to check for existence
func (Holdings) HasCurrencyName ¶
HasCurrencyName check if holdings account has a currency by name
func (Holdings) HasCurrencySymbolName ¶
HasCurrencySymbolName check if holdings account has a currency by symbol name
type IProvider ¶
type IProvider interface { // Returns Friendly Name Name() string }
Base Provider interface
type Price ¶
type Price interface { IProvider // GetExchange gets the value of currency1 in currency2 GetExchange(currency1, currency2 string) (string, error) }
Price Interface to providing pricing data
type Provider ¶
func GetAccountProvider ¶
GetAccountProvider gets a provider by name that implements the Account interface
func GetPricingProvider ¶
func GetProvider ¶
type ProviderIterator ¶
type ProviderIterator struct {
// contains filtered or unexported fields
}
func GetProviderIterator ¶
func GetProviderIterator() *ProviderIterator
func (*ProviderIterator) HasNext ¶
func (it *ProviderIterator) HasNext() bool
func (*ProviderIterator) Next ¶
func (it *ProviderIterator) Next() Provider