cannon

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cannon

type Cannon struct {
	Config *Config
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, log logrus.FieldLogger, config *Config, overrides *Override) (*Cannon, error)

func (*Cannon) ApplyOverrideBeforeStartAfterCreation added in v1.0.8

func (c *Cannon) ApplyOverrideBeforeStartAfterCreation(ctx context.Context) error

func (*Cannon) ServeMetrics

func (c *Cannon) ServeMetrics(ctx context.Context) error

func (*Cannon) ServePProf

func (c *Cannon) ServePProf(ctx context.Context) error

func (*Cannon) Shutdown

func (c *Cannon) Shutdown(ctx context.Context) error

func (*Cannon) Start

func (c *Cannon) Start(ctx context.Context) error

type Config

type Config struct {
	LoggingLevel string  `yaml:"logging" default:"info"`
	MetricsAddr  string  `yaml:"metricsAddr" default:":9090"`
	PProfAddr    *string `yaml:"pprofAddr"`

	// The name of the cannon
	Name string `yaml:"name"`

	// Ethereum configuration
	Ethereum ethereum.Config `yaml:"ethereum"`

	// Outputs configuration
	Outputs []output.Config `yaml:"outputs"`

	// Labels configures the cannon with labels
	Labels map[string]string `yaml:"labels"`

	// NTP Server to use for clock drift correction
	NTPServer string `yaml:"ntpServer" default:"time.google.com"`

	// Derivers configures the cannon with event derivers
	Derivers deriver.Config `yaml:"derivers"`

	// Coordinator configuration
	Coordinator coordinator.Config `yaml:"coordinator"`

	// Tracing configuration
	Tracing observability.TracingConfig `yaml:"tracing"`
}

func (*Config) ApplyOverrides added in v1.0.8

func (c *Config) ApplyOverrides(o *Override, log logrus.FieldLogger) error

func (*Config) CreateSinks

func (c *Config) CreateSinks(log logrus.FieldLogger) ([]output.Sink, error)

func (*Config) Validate

func (c *Config) Validate() error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDecoratedEvent

func (m *Metrics) AddDecoratedEvent(count int, eventType *xatu.DecoratedEvent, network string)

type Override added in v1.0.8

type Override struct {
	MetricsAddr struct {
		Enabled bool
		Value   string
	}
	BeaconNodeURL struct {
		Enabled bool
		Value   string
	}
	BeaconNodeAuthorizationHeader struct {
		Enabled bool
		Value   string
	}
	XatuOutputAuth struct {
		Enabled bool
		Value   string
	}
	XatuCoordinatorAuth struct {
		Enabled bool
		Value   string
	}
	NetworkName struct {
		Enabled bool
		Value   string
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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