gofer

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	origin string,
	wp query.WorkerPool,
	cli pkgEthereum.Client,
	baseURL string,
	params json.RawMessage) (origins.Handler, error)

Types

type ErrCyclicReference

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

func (ErrCyclicReference) Error

func (e ErrCyclicReference) Error() string

type Gofer

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

func (*Gofer) ConfigureAsyncGofer added in v0.4.4

func (c *Gofer) ConfigureAsyncGofer(cli pkgEthereum.Client, logger log.Logger) (gofer.StartableGofer, error)

ConfigureAsyncGofer returns a new async gofer instance.

func (*Gofer) ConfigureGofer

func (c *Gofer) ConfigureGofer(cli pkgEthereum.Client, logger log.Logger, noRPC bool) (gofer.Gofer, error)

ConfigureGofer returns a new async gofer instance.

func (*Gofer) ConfigureRPCAgent

func (c *Gofer) ConfigureRPCAgent(cli pkgEthereum.Client, gof gofer.Gofer, logger log.Logger) (*rpc.Agent, error)

ConfigureRPCAgent returns a new rpc.Agent instance.

type MedianPriceModel

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

type Origin

type Origin struct {
	Type   string          `json:"type"`
	Name   string          `json:"name"`
	URL    string          `json:"url"`
	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"`
}

Jump to

Keyboard shortcuts

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