Documentation ¶
Index ¶
- type Asset
- type AssetClass
- type AssetGroup
- type AssetGroupQuote
- type AssetGroupSymbolsBySource
- type AssetQuote
- type Config
- type ConfigAssetGroup
- type ConfigColorScheme
- type Context
- type Currency
- type CurrencyRate
- type CurrencyRates
- type Dependencies
- type DependenciesHttpClients
- type Exchange
- type ExchangeState
- type Holding
- type HoldingChange
- type Lot
- type Meta
- type QuoteExtended
- type QuotePrice
- type QuoteSource
- type Reference
- type StyleFn
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { Name string Symbol string Class AssetClass Currency Currency Holding Holding QuotePrice QuotePrice QuoteExtended QuoteExtended QuoteSource QuoteSource Exchange Exchange Meta Meta }
type AssetClass ¶
type AssetClass int
const ( AssetClassCash AssetClass = iota AssetClassStock AssetClassCryptocurrency AssetClassPrivateSecurity AssetClassUnknown )
type AssetGroup ¶
type AssetGroup struct { ConfigAssetGroup SymbolsBySource []AssetGroupSymbolsBySource }
type AssetGroupQuote ¶
type AssetGroupQuote struct { AssetGroup AssetGroup AssetQuotes []AssetQuote }
type AssetGroupSymbolsBySource ¶
type AssetGroupSymbolsBySource struct { Symbols []string Source QuoteSource }
type AssetQuote ¶
type AssetQuote struct { Name string Symbol string Class AssetClass Currency Currency QuotePrice QuotePrice QuoteExtended QuoteExtended QuoteSource QuoteSource Exchange Exchange Meta Meta }
AssetQuote represents a price quote and related attributes for a single security
type Config ¶
type Config struct { RefreshInterval int `yaml:"interval"` Watchlist []string `yaml:"watchlist"` Lots []Lot `yaml:"lots"` Separate bool `yaml:"show-separator"` ExtraInfoExchange bool `yaml:"show-tags"` ExtraInfoFundamentals bool `yaml:"show-fundamentals"` ShowSummary bool `yaml:"show-summary"` ShowHoldings bool `yaml:"show-holdings"` Proxy string `yaml:"proxy"` Sort string `yaml:"sort"` Currency string `yaml:"currency"` CurrencyConvertSummaryOnly bool `yaml:"currency-summary-only"` CurrencyDisableUnitCostConversion bool `yaml:"currency-disable-unit-cost-conversion"` ColorScheme ConfigColorScheme `yaml:"colors"` AssetGroup []ConfigAssetGroup `yaml:"groups"` }
Config represents user defined configuration
type ConfigAssetGroup ¶
type ConfigColorScheme ¶
type ConfigColorScheme struct { Text string `yaml:"text"` TextLight string `yaml:"text-light"` TextLabel string `yaml:"text-label"` TextLine string `yaml:"text-line"` TextTag string `yaml:"text-tag"` BackgroundTag string `yaml:"background-tag"` }
ConfigColorScheme represents user defined color scheme
type Context ¶
type Context struct { Config Config Groups []AssetGroup Reference Reference }
Context represents user defined configuration and derived reference configuration
type Currency ¶
type Currency struct { // Code is the original currency code of the asset FromCurrencyCode string // CodeConverted is the currency code that pricing and values have been converted into ToCurrencyCode string }
Currency is the original and converted currency if applicable
type CurrencyRate ¶
CurrencyRate represents a single currency conversion pair
type CurrencyRates ¶
type CurrencyRates map[string]CurrencyRate
CurrencyRates is a map of currency rates for lookup by currency that needs to be converted
type Dependencies ¶
type Dependencies struct { Fs afero.Fs HttpClients DependenciesHttpClients //nolint:golint,stylecheck,revive }
Dependencies represents references to external dependencies
type DependenciesHttpClients ¶
type DependenciesHttpClients struct { Default *resty.Client Yahoo *resty.Client YahooSession *resty.Client }
type Exchange ¶
type Exchange struct { Name string Delay float64 State ExchangeState IsActive bool IsRegularTradingSession bool }
type ExchangeState ¶
type ExchangeState int
const ( ExchangeStateOpen ExchangeState = iota ExchangeStatePremarket ExchangeStatePostmarket ExchangeStateClosed )
type Holding ¶
type Holding struct { Value float64 Cost float64 Quantity float64 UnitValue float64 UnitCost float64 DayChange HoldingChange TotalChange HoldingChange Weight float64 }
type HoldingChange ¶
type Lot ¶
type Lot struct { Symbol string `yaml:"symbol"` UnitCost float64 `yaml:"unit_cost"` Quantity float64 `yaml:"quantity"` FixedCost float64 `yaml:"fixed_cost"` }
Lot represents a cost basis lot
type QuoteExtended ¶
type QuotePrice ¶
type QuoteSource ¶
type QuoteSource int
const ( QuoteSourceYahoo QuoteSource = iota QuoteSourceUserDefined QuoteSourceCoingecko QuoteSourceUnknown QuoteSourceCoinCap QuoteSourceCoinbase )
type Reference ¶
type Reference struct { CurrencyRates CurrencyRates Styles Styles }
Reference represents derived configuration for internal use from user defined configuration