config

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReceiverPort point to a default port of receiver component, and is
	// unique so that components can be easily run on localhost for easy debugging
	DefaultReceiverPort = 22111
	// DefaultForwarderPort point to a default port of forwarder component
	DefaultForwarderPort = 22110
)

Variables

View Source
var Instance = defaultValues()

Instance holds configuration values

View Source
var Log = newLogger()

Log is a default logger for wathola

Functions

func Read

func Read(configFile string) error

Read a config file and update configuration object

func ReadIfPresent

func ReadIfPresent()

ReadIfPresent read a configuration file if it exists

Types

type Config

type Config struct {
	Sender    SenderConfig
	Forwarder ForwarderConfig
	Receiver  ReceiverConfig
	Readiness ReadinessConfig
	LogLevel  zapcore.Level
}

Config hold complete configuration

type ForwarderConfig

type ForwarderConfig struct {
	Target string
	Port   int
}

ForwarderConfig holds configuration for forwarder

type ReadinessConfig

type ReadinessConfig struct {
	Enabled bool
	URI     string
	Message string
	Status  int
}

ReadinessConfig holds a readiness configuration

type ReceiverConfig

type ReceiverConfig struct {
	Teardown ReceiverTeardownConfig
	Progress ReceiverProgressConfig
	Port     int
}

ReceiverConfig hold configuration for receiver

type ReceiverProgressConfig

type ReceiverProgressConfig struct {
	Duration time.Duration
}

ReceiverProgressConfig holds config receiver progress reporting

type ReceiverTeardownConfig

type ReceiverTeardownConfig struct {
	Duration time.Duration
}

ReceiverTeardownConfig holds config receiver teardown

type SenderConfig

type SenderConfig struct {
	Address  string
	Interval time.Duration
	Cooldown time.Duration
}

SenderConfig hold configuration for sender

Jump to

Keyboard shortcuts

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