Documentation ¶
Index ¶
Constants ¶
View Source
const ( ComponentName = "trackerIndex" MetricIndexValue = ComponentName + "_value" MetricInterval = ComponentName + "_interval" MetricRecCount = ComponentName + "_requests_total" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Apis ¶
type Apis struct { // The recommended interval for calling the Get method. // Some APIs will return an error if called more often // Due to API rate limiting of the provider. Interval format.Duration Endpoints []Endpoint }
Apis will be used in parsing index file.
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
Balancer implements DataSource interface.
func NewBalancer ¶
type BalancerPair ¶
type BalancerPair struct {
// contains filtered or unexported fields
}
BalancerPair to be fetched onchain.
type Bravenewcoin ¶
type Bravenewcoin struct { *JSONapi // contains filtered or unexported fields }
func NewBravenewcoin ¶
type DataSource ¶
type DataSource interface { // Source returns the data source. Source() string // Get returns current api value. Get(context.Context) (float64, float64, error) // The recommended interval for calling the Get method. // Some APIs will return an error if called more often // Due to API rate limiting of the provider. Interval() time.Duration }
type JSONapi ¶
type JSONapi struct { Parser URLExpander // contains filtered or unexported fields }
type JSONapiVolume ¶
type JSONapiVolume struct { *JSONapi // contains filtered or unexported fields }
func NewJSONapiVolume ¶
func NewJSONapiVolume(interval time.Duration, url string, parser Parser) *JSONapiVolume
NewJSONapiVolume are treated differently and return 0 values when the api returns the same timestamp. This is to avoid double counting volumes for the same time period. Another way is to skip adding the data, but this messes up the confidence calculations which counts total added data points.
type JsonPathParser ¶
type JsonPathParser struct {
// contains filtered or unexported fields
}
type TrackerIndex ¶
type TrackerIndex struct {
// contains filtered or unexported fields
}
func (*TrackerIndex) Start ¶
func (self *TrackerIndex) Start() error
func (*TrackerIndex) Stop ¶
func (self *TrackerIndex) Stop()
type URLEnvExpander ¶
type URLEnvExpander struct {
// contains filtered or unexported fields
}
func (*URLEnvExpander) UrlExpanded ¶
func (self *URLEnvExpander) UrlExpanded() (string, error)
func (*URLEnvExpander) UrlRaw ¶
func (self *URLEnvExpander) UrlRaw() string
type URLExpander ¶
type Uniswap ¶
type Uniswap struct {
// contains filtered or unexported fields
}
Uniswap implements DataSource interface.
func NewUniswap ¶
func NewUniswap(pair string, address string, interval time.Duration, client bind.ContractCaller) *Uniswap
NewUniswap creates new Uniswap for provided pair and pair address.
Click to show internal directories.
Click to hide internal directories.