Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProviderKraken = "kraken" ProviderBinance = "binance" )
Variables ¶
View Source
var ( // ErrEmptyConfigPath defines a sentinel error for an empty config path. ErrEmptyConfigPath = errors.New("empty configuration file path") // SupportedProviders defines a lookup table of all the supported currency API // providers. SupportedProviders = map[string]struct{}{ ProviderKraken: {}, ProviderBinance: {}, } )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server Server `toml:"server"` CurrencyPairs []CurrencyPair `toml:"currency_pairs" validate:"required,gt=0,dive,required"` }
Config defines all necessary price-feeder configuration parameters.
func ParseConfig ¶
ParseConfig attempts to read and parse configuration from the given file path. An error is returned if reading or parsing the config fails.
type CurrencyPair ¶
type CurrencyPair struct { Base string `toml:"base" validate:"required"` Quote string `toml:"quote" validate:"required"` Providers []string `toml:"providers" validate:"required,gt=0,dive,required"` }
CurrencyPair defines a price quote of the exchange rate for two different currencies and the supported providers for getting the exchange rate.
Click to show internal directories.
Click to hide internal directories.