config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 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 {
	LogFile    string           `yaml:"log_file" env:"NCOQ_LOG_FILE" env-default:""`
	LogLevel   string           `yaml:"log_level" env:"NCOQ_LOG_LEVEL" env-default:"ERROR"`
	HTTPServer HTTPServerConfig `yaml:"http_server"`
	OMNIbus    OMNIbus          `yaml:"omnibus"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type HTTPServerConfig

type HTTPServerConfig struct {
	Listen      string        `yaml:"listen" env:"NCOQ_HTTP_LISTEN" env-default:":5000"`
	Timeout     time.Duration `yaml:"timeout" env:"NCOQ_HTTP_TIMEOUT" env-default:"5s"`
	IdleTimeout time.Duration `yaml:"idle_timeout" env:"NCOQ_HTTP_IDLE_TIMEOUT" env-default:"60s"`
}

type OMNIbus

type OMNIbus struct {
	Clusters        map[string]SeedList `yaml:"clusters" env:"NCOQ_OMNI_CLUSTERS" env-default:"AGG1:localhost:4100|localhost:4101"`
	ConnectionLabel string              `yaml:"connection_label" env:"NCOQ_OMNI_CONN_LABEL" env-default:"nco-qoordinator"`
	MaxConnections  int                 `yaml:"max_connections" env:"NCOQ_OMNI_MAX_CONN" env-default:"10"`
	RandomFailOver  bool                `yaml:"random_fail_over" env:"NCOQ_OMNI_RAND_FAILOVER" env-default:"false"`
	FailBack        bool                `yaml:"fail_back" env:"NCOQ_OMNI_FAILBACK" env-default:"true"`
	FailBackDelay   time.Duration       `yaml:"fail_back_delay" env:"NCOQ_OMNI_FAILBACK_DELAY" env-default:"300s"`
}

type SeedList

type SeedList []string

func (*SeedList) UnmarshalText

func (s *SeedList) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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