cannon

package
v0.0.168 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 31 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) (*Cannon, 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) 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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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