config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel string `yaml:"log_level"`
	DryRun   bool   `yaml:"dry_run"`

	Metrics MetricsConfig `yaml:"metrics"`
	Healthz HealthzConfig `yaml:"healthz"`

	PollInterval        time.Duration `yaml:"poll_interval"`
	NodeStateExpiration time.Duration `yaml:"node_state_expiration"`
	RPCTimeout          time.Duration `yaml:"rpc_timeout"`

	Nodes map[string]*NodeConfig `yaml:"nodes"`

	Networks map[string]*NetworkConfig `yaml:"networks"`
}

func New

func New(file string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type HealthzConfig

type HealthzConfig struct {
	Enabled bool   `yaml:"enabled"`
	Host    string `yaml:"host"`
	Port    string `yaml:"port"`
}

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `yaml:"enabled"`
	Debug   bool   `yaml:"debug"`
	Host    string `yaml:"host"`
	Port    string `yaml:"port"`
}

type NetworkConfig

type NetworkConfig struct {
	Members []string `yaml:"members"`
}

type NodeConfig

type NodeConfig struct {
	RPCAddress       string `yaml:"rpc_address"`
	PeerID           string `yaml:"peer_id"`            // libp2p 54-char PeerID
	PeerAddress      string `yaml:"peer_address"`       // libp2p PeerAddress, supports {peer_id} as a placeholder
	PeerAddressLocal string `yaml:"peer_address_local"` // same as PeerAddress, but used for connecting in the same cluster
	Cluster          string `yaml:"cluster"`
	PreventInbound   bool   `yaml:"prevent_inbound"`
	PreventOutbound  bool   `yaml:"prevent_outbound"`
}

Jump to

Keyboard shortcuts

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