config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 4 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 {
	Logging LoggingConfig `yaml:"logging"`
	Metrics MetricsConfig `yaml:"metrics"`
	Dns     DnsConfig     `yaml:"dns"`
	Debug   DebugConfig   `yaml:"debug"`
	Indexer IndexerConfig `yaml:"indexer"`
	State   StateConfig   `yaml:"state"`
}

func GetConfig

func GetConfig() *Config

GetConfig returns the global config instance

func Load

func Load(configFile string) (*Config, error)

type DebugConfig

type DebugConfig struct {
	ListenAddress string `yaml:"address" envconfig:"DEBUG_ADDRESS"`
	ListenPort    uint   `yaml:"port"    envconfig:"DEBUG_PORT"`
}

type DnsConfig

type DnsConfig struct {
	ListenAddress    string   `yaml:"address"          envconfig:"DNS_LISTEN_ADDRESS"`
	ListenPort       uint     `yaml:"port"             envconfig:"DNS_LISTEN_PORT"`
	RecursionEnabled bool     `yaml:"recursionEnabled" envconfig:"DNS_RECURSION"`
	FallbackServers  []string `yaml:"fallbackServers"  envconfig:"DNS_FALLBACK_SERVERS"`
}

type IndexerConfig

type IndexerConfig struct {
	Network       string `yaml:"network"       envconfig:"INDEXER_NETWORK"`
	NetworkMagic  uint32 `yaml:"networkMagic"  envconfig:"INDEXER_NETWORK_MAGIC"`
	Address       string `yaml:"address"       envconfig:"INDEXER_TCP_ADDRESS"`
	SocketPath    string `yaml:"socketPath"    envconfig:"INDEXER_SOCKET_PATH"`
	ScriptAddress string `yaml:"scriptAddress" envconfig:"INDEXER_SCRIPT_ADDRESS"`
	InterceptHash string `yaml:"interceptHash" envconfig:"INDEXER_INTERCEPT_HASH"`
	InterceptSlot uint64 `yaml:"interceptSlot" envconfig:"INDEXER_INTERCEPT_SLOT"`
}

type LoggingConfig

type LoggingConfig struct {
	Healthchecks bool   `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"`
	Level        string `yaml:"level"        envconfig:"LOGGING_LEVEL"`
	QueryLog     bool   `yaml:"queryLog"     envconfig:"LOGGING_QUERY_LOG"`
}

type MetricsConfig

type MetricsConfig struct {
	ListenAddress string `yaml:"address" envconfig:"METRICS_LISTEN_ADDRESS"`
	ListenPort    uint   `yaml:"port"    envconfig:"METRICS_LISTEN_PORT"`
}

type StateConfig

type StateConfig struct {
	Directory string `yaml:"dir" envconfig:"STATE_DIR"`
}

Jump to

Keyboard shortcuts

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