priceprovider

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: AGPL-3.0 Imports: 17 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) 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
}

Jump to

Keyboard shortcuts

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