spire

package
v0.0.0-...-9e55092 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentServices

type AgentServices struct {
	SpireAgent *spire.Agent
	Transport  pkgTransport.Service
	PriceStore *store.Store
	Logger     log.Logger
	// contains filtered or unexported fields
}

AgentServices returns the services that are configured from the Config struct.

func (*AgentServices) Start

func (s *AgentServices) Start(ctx context.Context) error

Start implements the supervisor.Service interface.

func (*AgentServices) Wait

func (s *AgentServices) Wait() <-chan error

Wait implements the supervisor.Service interface.

type ClientServices

type ClientServices struct {
	SpireClient *spire.Client
	Logger      log.Logger
	// contains filtered or unexported fields
}

ClientServices returns the services that are configured from the Config struct.

func (*ClientServices) Start

func (s *ClientServices) Start(ctx context.Context) error

Start implements the supervisor.Service interface.

func (*ClientServices) Wait

func (s *ClientServices) Wait() <-chan error

Wait implements the supervisor.Service interface.

type Config

type Config struct {
	Spire     ConfigSpire            `hcl:"spire,block"`
	Transport transportConfig.Config `hcl:"transport,block"`
	Ethereum  ethereumConfig.Config  `hcl:"ethereum,block"`
	Logger    *loggerConfig.Config   `hcl:"logger,block,optional"`

	// HCL fields:
	Remain  hcl.Body        `hcl:",remain"` // To ignore unknown blocks.
	Content hcl.BodyContent `hcl:",content"`
}

Config is the configuration for Spire.

func (*Config) ClientServices

func (c *Config) ClientServices(baseLogger log.Logger, appName, appVersion string) (*ClientServices, error)

ClientServices returns the services configured for Spire.

func (Config) DefaultEmbeds

func (Config) DefaultEmbeds() [][]byte

func (*Config) Services

func (c *Config) Services(baseLogger log.Logger, appName string, appVersion string) (pkgSupervisor.Service, error)

Services returns the services configured for Spire.

func (*Config) StreamServices

func (c *Config) StreamServices(baseLogger log.Logger, appName string, appVersion string, topics ...string) (*StreamServices, error)

StreamServices returns the services configured for Spire.

type ConfigSpire

type ConfigSpire struct {
	// RPCListenAddr is an address to listen for RPC requests.
	RPCListenAddr string `hcl:"rpc_listen_addr"`

	// RPCAgentAddr is an address of the agent to connect to.
	RPCAgentAddr string `hcl:"rpc_agent_addr"`

	// Pairs is a list of pairs to store in the price store.
	Pairs []string `hcl:"pairs"`

	// Pairs is a list of pairs to store in the price store.
	Feeds []types.Address `hcl:"feeds"`

	// EthereumKey is a name of an Ethereum key to use for signing
	// prices.
	EthereumKey string `hcl:"ethereum_key,optional"`

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

func (*ConfigSpire) ConfigureAgent

func (c *ConfigSpire) ConfigureAgent(
	logger log.Logger,
	transport pkgTransport.Service,
	priceStore *store.Store,
) (
	*spire.Agent, error,
)

func (*ConfigSpire) ConfigureClient

func (c *ConfigSpire) ConfigureClient(kr ethereumConfig.KeyRegistry) (*spire.Client, error)

func (*ConfigSpire) PriceStore

func (c *ConfigSpire) PriceStore(l log.Logger, t pkgTransport.Service) (*store.Store, error)

type StreamServices

type StreamServices struct {
	Transport pkgTransport.Service
	Logger    log.Logger
	// contains filtered or unexported fields
}

StreamServices returns the services that are configured from the Config struct.

func (*StreamServices) Start

func (s *StreamServices) Start(ctx context.Context) error

Start implements the supervisor.Service interface.

func (*StreamServices) Wait

func (s *StreamServices) Wait() <-chan error

Wait implements the supervisor.Service interface.

Jump to

Keyboard shortcuts

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