config

package
v0.0.0-...-a1b7323 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsEndpoint = "/metrics"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlackboxConfigReader

type BlackboxConfigReader struct {
}

func NewBlackboxConfigReader

func NewBlackboxConfigReader() BlackboxConfigReader

func (*BlackboxConfigReader) LoadMetricsSettings

func (c *BlackboxConfigReader) LoadMetricsSettings() (*MetricsSettings, error)

func (*BlackboxConfigReader) LoadServerSettings

func (c *BlackboxConfigReader) LoadServerSettings() (*ServerSettings, error)

func (*BlackboxConfigReader) LoadTesterConfig

func (c *BlackboxConfigReader) LoadTesterConfig(testerSettings *TesterSettings) (*TesterConfig, error)

func (*BlackboxConfigReader) LoadTesterSettings

func (c *BlackboxConfigReader) LoadTesterSettings() (*TesterSettings, error)

type Definition

type Definition struct {
	Type   string                 `yaml:"type"`
	Config map[string]interface{} `yaml:"config"`
}

type Evaluatable

type Evaluatable interface {
	Evaluate() error
}

type Flow

type Flow struct {
	Config FlowConfig `yaml:"config"`
	Steps  []string   `yaml:"steps"`
}

type FlowConfig

type FlowConfig struct {
	Frequency string  `yaml:"frequency"`
	Timeout   *string `yaml:"timeout,omitempty"`
}

type MetricsSettings

type MetricsSettings struct {
	Enabled      bool   `env:"METRICS_ENABLE" envDefault:"true"`
	Environment  string `env:"METRICS_ENVIRONMENT" envDefault:"local"`
	MetricPrefix string `env:"METRICS_PREFIX" envDefault:"thin_blackbox"`
	MetricPort   string `env:"METRICS_PORT" envDefault:"8888"`
}

func (*MetricsSettings) Evaluate

func (s *MetricsSettings) Evaluate() error

func (*MetricsSettings) Validate

func (s *MetricsSettings) Validate() error

type ServerSettings

type ServerSettings struct {
	LocalListenIP       string `env:"SERVER_LOCAL_LISTEN_IP" envDefault:"127.0.0.1"`
	LocalListenPort     string `env:"SERVER_LOCAL_LISTEN_PORT" envDefault:"8080"`
	ShutDownGracePeriod string `env:"SERVER_SHUTDOWN_GRACE_PERIOD" envDefault:"10s"`

	ParsedShutDownGracePeriod time.Duration
}

func (*ServerSettings) Evaluate

func (s *ServerSettings) Evaluate() error

func (*ServerSettings) Validate

func (s *ServerSettings) Validate() error

type SettingsInterface

type SettingsInterface interface {
	Evaluatable
	Validatable
}

type TesterConfig

type TesterConfig struct {
	Definitions map[string]Definition `yaml:"definitions"`
	Flows       map[string]Flow       `yaml:"flows"`
}

type TesterSettings

type TesterSettings struct {
	ConfigFilename string `env:"TESTER_CONFIG_FILENAME" envDefault:"config.yaml"`
	ConfigFolder   string `env:"TESTER_CONFIG_FOLDER" envDefault:"configuration"`
	Environment    string `env:"TESTER_ENVIRONMENT" envDefault:"dev"`
}

func (*TesterSettings) Evaluate

func (s *TesterSettings) Evaluate() error

func (*TesterSettings) Validate

func (s *TesterSettings) Validate() error

type Validatable

type Validatable interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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