priceprovider

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: AGPL-3.0 Imports: 20 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,
	clients ethereum.ClientRegistry,
	params map[string]any,
) (origins.Handler, error)

Types

type AgentDependencies

type AgentDependencies struct {
	Provider provider.Provider
	Logger   log.Logger
}

type AsyncDependencies

type AsyncDependencies struct {
	Clients ethereumConfig.ClientRegistry
	Logger  log.Logger
}

type Config

type Config struct {
	// RPCListenAddr is the address on which the RPC server will listen.
	RPCListenAddr string `hcl:"rpc_listen_addr,optional"`

	// RPCAgentAddr is the address of the RPC agent.
	RPCAgentAddr string `hcl:"rpc_agent_addr,optional"`

	// Origins is a configuration of price origins.
	Origins []configOrigin `hcl:"origin,block"`

	// PriceModels is a configuration of price models.
	PriceModels []configSource `hcl:"price_model,block"`

	// Hooks is a configuration of hooks.
	Hooks []configHook `hcl:"hook,block"`

	// HCL fields:
	Range   hcl.Range       `hcl:",range"`
	Content hcl.BodyContent `hcl:",content"`
	// contains filtered or unexported fields
}

func (*Config) AsyncPriceProvider

func (c *Config) AsyncPriceProvider(d AsyncDependencies) (provider.Provider, error)

AsyncPriceProvider returns a new async gofer instance.

func (*Config) ConfigureDataProvider added in v0.11.0

func (c *Config) ConfigureDataProvider(d Dependencies) (datapoint.Provider, error)

func (*Config) PriceHook

func (c *Config) PriceHook(d HookDependencies) (provider.PriceHook, error)

func (*Config) PriceProvider

func (c *Config) PriceProvider(d Dependencies, noRPC bool) (provider.Provider, error)

PriceProvider returns a new async gofer instance.

func (*Config) RPCAgent

func (c *Config) RPCAgent(d AgentDependencies) (*rpc.Agent, error)

RPCAgent returns a new rpc.Agent instance.

type Dependencies

type Dependencies struct {
	Clients ethereumConfig.ClientRegistry
	Logger  log.Logger
}

type HookDependencies

type HookDependencies struct {
	Context context.Context
	Clients ethereumConfig.ClientRegistry
}

type Provider added in v0.11.0

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

func (*Provider) DataPoint added in v0.11.0

func (p *Provider) DataPoint(_ context.Context, model string) (datapoint.Point, error)

func (*Provider) DataPoints added in v0.11.0

func (p *Provider) DataPoints(_ context.Context, models ...string) (map[string]datapoint.Point, error)

func (*Provider) Model added in v0.11.0

func (p *Provider) Model(_ context.Context, model string) (datapoint.Model, error)

func (*Provider) ModelNames added in v0.11.0

func (p *Provider) ModelNames(_ context.Context) []string

func (*Provider) Models added in v0.11.0

func (p *Provider) Models(_ context.Context, models ...string) (map[string]datapoint.Model, error)

Jump to

Keyboard shortcuts

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