config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultOriginSet

func DefaultOriginSet(pool query.WorkerPool) *origins.Set

func NewHandler

func NewHandler(handlerType string, pool query.WorkerPool, params json.RawMessage) (origins.Handler, error)

nolint

Types

type Config

type Config struct {
	RPC         RPC                   `json:"rpc"`
	Origins     map[string]Origin     `json:"origins"`
	PriceModels map[string]PriceModel `json:"priceModels"`
}

func (*Config) ConfigureGofer

func (c *Config) ConfigureGofer(logger log.Logger) (gofer.Gofer, error)

ConfigureGofer returns a new Gofer instance.

func (*Config) ConfigureRPCAgent

func (c *Config) ConfigureRPCAgent(logger log.Logger) (*rpc.Agent, error)

ConfigureRPCAgent returns a new rpc.Agent instance.

func (*Config) ConfigureRPCClient

func (c *Config) ConfigureRPCClient(l log.Logger) (*rpc.Gofer, error)

ConfigureRPCClient returns a new rpc.RPC instance.

type ErrCyclicReference

type ErrCyclicReference struct {
	Pair gofer.Pair
	Path []nodes.Node
}

func (ErrCyclicReference) Error

func (e ErrCyclicReference) Error() string

type Instances

type Instances struct {
	Gofer  gofer.Gofer
	Feeder *feeder.Feeder
}

type MedianPriceModel

type MedianPriceModel struct {
	MinSourceSuccess int `json:"minimumSuccessfulSources"`
}

type Origin

type Origin struct {
	Type   string          `json:"type"`
	Name   string          `json:"name"`
	Params json.RawMessage `json:"params"`
}

type PriceModel

type PriceModel struct {
	Method  string          `json:"method"`
	Sources [][]Source      `json:"sources"`
	Params  json.RawMessage `json:"params"`
	TTL     int             `json:"ttl"`
}

type RPC

type RPC struct {
	Address string `json:"address"`
}

type Source

type Source struct {
	Origin string `json:"origin"`
	Pair   string `json:"pair"`
	TTL    int    `json:"ttl"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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