driver

package
v0.0.0-...-4404711 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bancor_Token2ETH

func Bancor_Token2ETH(symbol1 string, symbol2 string) (float64, error)

func DoQuery

func DoQuery(driver Driver, key []byte) dt.Answer

func FromConfig

func FromConfig(config *viper.Viper) map[common.Address]Driver

func GetMultiplierValue

func GetMultiplierValue(price float64, m int64) *big.Int

func Kyber_Token2ETH

func Kyber_Token2ETH(singleSymbol string) (float64, error)

func Majority

func Majority(values []*big.Int) (*big.Int, int, error)

func Median

func Median(values []*big.Int) *big.Int

func PriceToBigInt

func PriceToBigInt(price float64) *big.Int

func TurnOnQueryDebugging

func TurnOnQueryDebugging()

Types

type AggMajority

type AggMajority struct {
	// contains filtered or unexported fields
}

func (*AggMajority) Configure

func (aggmajority *AggMajority) Configure(config *viper.Viper)

func (*AggMajority) Query

func (aggmajority *AggMajority) Query(key []byte) dt.Answer

type AggMedian

type AggMedian struct {
	// contains filtered or unexported fields
}

func (*AggMedian) Configure

func (adpt *AggMedian) Configure(config *viper.Viper)

func (*AggMedian) Query

func (agg *AggMedian) Query(key []byte) dt.Answer

type AlphaVantageForex

type AlphaVantageForex struct{}

func (*AlphaVantageForex) Configure

func (*AlphaVantageForex) Configure(config *viper.Viper)

func (*AlphaVantageForex) Query

func (a *AlphaVantageForex) Query(key []byte) dt.Answer

func (*AlphaVantageForex) QuerySpotPrice

func (*AlphaVantageForex) QuerySpotPrice(symbol string) (float64, error)

type AlphaVantageStock

type AlphaVantageStock struct{}

func (*AlphaVantageStock) Configure

func (*AlphaVantageStock) Configure(config *viper.Viper)

func (*AlphaVantageStock) Query

func (a *AlphaVantageStock) Query(key []byte) dt.Answer

func (*AlphaVantageStock) QuerySpotPrice

func (*AlphaVantageStock) QuerySpotPrice(symbol string) (float64, error)

type Bancor

type Bancor struct{}

func (*Bancor) Configure

func (*Bancor) Configure(*viper.Viper)

func (*Bancor) Query

func (a *Bancor) Query(key []byte) dt.Answer

func (*Bancor) QuerySpotPrice

func (*Bancor) QuerySpotPrice(symbol string) (float64, error)

type Binance

type Binance struct{}

func (*Binance) Configure

func (*Binance) Configure(*viper.Viper)

func (*Binance) Query

func (a *Binance) Query(key []byte) dt.Answer

func (*Binance) QueryBinancePrice

func (*Binance) QueryBinancePrice() (float64, error)

type Bitfinex

type Bitfinex struct{}

func (*Bitfinex) Configure

func (*Bitfinex) Configure(*viper.Viper)

func (*Bitfinex) Query

func (a *Bitfinex) Query(key []byte) dt.Answer

func (*Bitfinex) QuerySpotPrice

func (*Bitfinex) QuerySpotPrice(symbol string) (float64, error)

type Bitstamp

type Bitstamp struct{}

func (*Bitstamp) Configure

func (*Bitstamp) Configure(*viper.Viper)

func (*Bitstamp) Query

func (a *Bitstamp) Query(key []byte) dt.Answer

func (*Bitstamp) QuerySpotPrice

func (*Bitstamp) QuerySpotPrice(symbol string) (float64, error)

type Bittrex

type Bittrex struct{}

func (*Bittrex) Configure

func (*Bittrex) Configure(*viper.Viper)

func (*Bittrex) Query

func (a *Bittrex) Query(key []byte) dt.Answer

func (*Bittrex) QuerySpotPrice

func (*Bittrex) QuerySpotPrice(symbol string) (float64, error)

type CoinBase

type CoinBase struct{}

func (*CoinBase) Configure

func (*CoinBase) Configure(*viper.Viper)

func (*CoinBase) Query

func (a *CoinBase) Query(key []byte) dt.Answer

func (*CoinBase) QuerySpotPrice

func (*CoinBase) QuerySpotPrice(symbol string) (float64, error)

type CoinGecko

type CoinGecko struct{}

func (*CoinGecko) Configure

func (*CoinGecko) Configure(*viper.Viper)

func (*CoinGecko) Query

func (a *CoinGecko) Query(key []byte) dt.Answer

func (*CoinGecko) QuerySpotPrice

func (*CoinGecko) QuerySpotPrice(symbol string) (float64, error)

type CoinMarketCap

type CoinMarketCap struct{}

func (*CoinMarketCap) Configure

func (*CoinMarketCap) Configure(config *viper.Viper)

func (*CoinMarketCap) Query

func (a *CoinMarketCap) Query(key []byte) dt.Answer

func (*CoinMarketCap) QuerySpotPrice

func (*CoinMarketCap) QuerySpotPrice(symbol string) (float64, error)

type CryptoCompare

type CryptoCompare struct{}

func (*CryptoCompare) Configure

func (*CryptoCompare) Configure(*viper.Viper)

func (*CryptoCompare) Query

func (a *CryptoCompare) Query(key []byte) dt.Answer

func (*CryptoCompare) QuerySpotPrice

func (*CryptoCompare) QuerySpotPrice(symbol string) (float64, error)

type CurrencyConverter

type CurrencyConverter struct{}

func (*CurrencyConverter) Configure

func (*CurrencyConverter) Configure(config *viper.Viper)

func (*CurrencyConverter) Query

func (a *CurrencyConverter) Query(key []byte) dt.Answer

func (*CurrencyConverter) QuerySpotPrice

func (*CurrencyConverter) QuerySpotPrice(symbol string) (float64, error)

type DataNba

type DataNba struct{}

func (*DataNba) Configure

func (*DataNba) Configure(*viper.Viper)

func (*DataNba) Query

func (n *DataNba) Query(key []byte) dt.Answer

func (*DataNba) QueryDataNbaScore

func (*DataNba) QueryDataNbaScore(date string, shortName string) ([]int, error)

type DelegateDriver

type DelegateDriver struct {
	// contains filtered or unexported fields
}

func (*DelegateDriver) Configure

func (dd *DelegateDriver) Configure(config *viper.Viper)

func (*DelegateDriver) Query

func (dd *DelegateDriver) Query(key []byte) dt.Answer

type Driver

type Driver interface {
	Configure(*viper.Viper)
	Query([]byte) dt.Answer
}

func FromConfigIndividual

func FromConfigIndividual(config *viper.Viper) Driver

type EplEspn

type EplEspn struct{}

func (*EplEspn) Configure

func (*EplEspn) Configure(*viper.Viper)

func (*EplEspn) Query

func (e *EplEspn) Query(key []byte) dt.Answer

func (*EplEspn) QueryEplScore

func (*EplEspn) QueryEplScore(date string, shortName string) ([]int, error)

type EplSport

type EplSport struct{}

func (*EplSport) Configure

func (*EplSport) Configure(*viper.Viper)

func (*EplSport) Query

func (e *EplSport) Query(key []byte) dt.Answer

func (*EplSport) QueryEplSportScore

func (*EplSport) QueryEplSportScore(date string, shortName string) ([]int, error)

type FinancialModelPrep

type FinancialModelPrep struct{}

func (*FinancialModelPrep) Configure

func (*FinancialModelPrep) Configure(*viper.Viper)

func (*FinancialModelPrep) Query

func (a *FinancialModelPrep) Query(key []byte) dt.Answer

func (*FinancialModelPrep) QuerySpotPrice

func (*FinancialModelPrep) QuerySpotPrice(symbol string) (float64, error)

type FreeForexApi

type FreeForexApi struct{}

func (*FreeForexApi) Configure

func (*FreeForexApi) Configure(*viper.Viper)

func (*FreeForexApi) Query

func (a *FreeForexApi) Query(key []byte) dt.Answer

func (*FreeForexApi) QuerySpotPrice

func (*FreeForexApi) QuerySpotPrice(symbol string) (float64, error)

type Gemini

type Gemini struct{}

func (*Gemini) Configure

func (*Gemini) Configure(*viper.Viper)

func (*Gemini) Query

func (a *Gemini) Query(key []byte) dt.Answer

func (*Gemini) QuerySpotPrice

func (*Gemini) QuerySpotPrice(symbol string) (float64, error)

type IdleDriver

type IdleDriver struct{}

func (*IdleDriver) Configure

func (*IdleDriver) Configure(*viper.Viper)

func (*IdleDriver) Query

func (*IdleDriver) Query(key []byte) dt.Answer

type Kraken

type Kraken struct{}

func (*Kraken) Configure

func (*Kraken) Configure(*viper.Viper)

func (*Kraken) Query

func (a *Kraken) Query(key []byte) dt.Answer

func (*Kraken) QuerySpotPrice

func (*Kraken) QuerySpotPrice(symbol string) (float64, error)

type Kyber

type Kyber struct{}

func (*Kyber) Configure

func (*Kyber) Configure(*viper.Viper)

func (*Kyber) Query

func (a *Kyber) Query(key []byte) dt.Answer

func (*Kyber) QuerySpotPrice

func (*Kyber) QuerySpotPrice(symbol string) (float64, error)

type MlbEspn

type MlbEspn struct{}

func (*MlbEspn) Configure

func (*MlbEspn) Configure(*viper.Viper)

func (*MlbEspn) Query

func (e *MlbEspn) Query(key []byte) dt.Answer

func (*MlbEspn) QueryMlbScore

func (*MlbEspn) QueryMlbScore(date string, shortName string, round string) ([]int, error)

type MockDriver

type MockDriver struct {
	// contains filtered or unexported fields
}

func (*MockDriver) Configure

func (adpt *MockDriver) Configure(*viper.Viper)

func (*MockDriver) Query

func (adpt *MockDriver) Query(key []byte) dt.Answer

func (*MockDriver) Set

func (adpt *MockDriver) Set(key string, rawValue string)

type NbaEspn

type NbaEspn struct{}

func (*NbaEspn) Configure

func (*NbaEspn) Configure(*viper.Viper)

func (*NbaEspn) Query

func (e *NbaEspn) Query(key []byte) dt.Answer

func (*NbaEspn) QueryNbaScore

func (*NbaEspn) QueryNbaScore(date string, shortName string) ([]int, error)

type NflEspn

type NflEspn struct{}

func (*NflEspn) Configure

func (*NflEspn) Configure(*viper.Viper)

func (*NflEspn) Query

func (n *NflEspn) Query(key []byte) dt.Answer

func (*NflEspn) QueryNflScore

func (*NflEspn) QueryNflScore(date string, shortName string) ([]int, error)

type OnChainFX

type OnChainFX struct{}

func (*OnChainFX) Configure

func (*OnChainFX) Configure(*viper.Viper)

func (*OnChainFX) Query

func (a *OnChainFX) Query(key []byte) dt.Answer

func (*OnChainFX) QuerySpotPrice

func (*OnChainFX) QuerySpotPrice(symbol string) (float64, error)

type OpenMarketCap

type OpenMarketCap struct{}

func (*OpenMarketCap) Configure

func (*OpenMarketCap) Configure(*viper.Viper)

func (*OpenMarketCap) Query

func (a *OpenMarketCap) Query(key []byte) dt.Answer

func (*OpenMarketCap) QuerySpotPrice

func (*OpenMarketCap) QuerySpotPrice(symbol string) (float64, error)

type PriceHttp

type PriceHttp struct {
	Endpoint string
	Method   string
}

func (*PriceHttp) Configure

func (a *PriceHttp) Configure(config *viper.Viper)

func (*PriceHttp) Query

func (a *PriceHttp) Query(key []byte) dt.Answer

func (*PriceHttp) QuerySpotPrice

func (a *PriceHttp) QuerySpotPrice(symbol string) (float64, error)

type Ratesapi

type Ratesapi struct{}

func (*Ratesapi) Configure

func (*Ratesapi) Configure(*viper.Viper)

func (*Ratesapi) Query

func (a *Ratesapi) Query(key []byte) dt.Answer

func (*Ratesapi) QuerySpotPrice

func (*Ratesapi) QuerySpotPrice(symbol string) (float64, error)

type RegEx

type RegEx struct {
	// contains filtered or unexported fields
}

func (*RegEx) Configure

func (drv *RegEx) Configure(config *viper.Viper)

func (*RegEx) Query

func (drv *RegEx) Query(key []byte) dt.Answer

type Uniswap

type Uniswap struct{}

func (*Uniswap) Configure

func (*Uniswap) Configure(*viper.Viper)

func (*Uniswap) Query

func (a *Uniswap) Query(key []byte) dt.Answer

func (*Uniswap) QuerySpotPrice

func (*Uniswap) QuerySpotPrice(symbol string) (float64, error)

type ValueWithLastUpdated

type ValueWithLastUpdated struct {
	// contains filtered or unexported fields
}

type WebRequest

type WebRequest struct {
	// contains filtered or unexported fields
}

func (*WebRequest) Configure

func (w *WebRequest) Configure(*viper.Viper)

func (*WebRequest) Query

func (w *WebRequest) Query(_key []byte) dt.Answer

type WorldTradingData

type WorldTradingData struct{}

func (*WorldTradingData) Configure

func (*WorldTradingData) Configure(config *viper.Viper)

func (*WorldTradingData) Query

func (a *WorldTradingData) Query(key []byte) dt.Answer

func (*WorldTradingData) QuerySpotPrice

func (*WorldTradingData) QuerySpotPrice(symbol string) (float64, error)

Jump to

Keyboard shortcuts

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