config

package
v0.0.0-...-e825a9d Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 7 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 {
	Connection Connection `mapstructure:"connection" validate:"required"`
	Logging    Logging    `mapstructure:"logging" validate:"required"`
	Dimming    Dimming    `mapstructure:"dimming" validate:"required"`
}

func ReadConfig

func ReadConfig() *Config

type Connection

type Connection struct {
	FrontendPort *int    `mapstructure:"frontendPort" validate:"required"`
	BackendHost  *string `mapstructure:"backendHost" validate:"required"`
	BackendPort  *int    `mapstructure:"backendPort" validate:"required"`
	AdminPort    *int    `mapstructure:"adminPort" validate:"required"`
}

type Controller

type Controller struct {
	SamplePeriod *float64 `mapstructure:"samplePeriod" validate:"required"`
	Percentile   *string  `mapstructure:"percentile" validate:"oneof=p50 p75 p95"`
	Setpoint     *float64 `mapstructure:"setpoint" validate:"required"`
	Kp           *float64 `mapstructure:"kp" validate:"required"`
	Ki           *float64 `mapstructure:"ki" validate:"required"`
	Kd           *float64 `mapstructure:"kd" validate:"required"`
}

type DimmableComponent

type DimmableComponent struct {
	Method MatchableMethod `mapstructure:"method" validate:"required"`
	Path   *string         `mapstructure:"path" validate:"required"`
	// Probability is a pointer as probabilities will be set to an external
	// default if it is nil.
	Probability *float64     `mapstructure:"probability"`
	Exclusions  []Exclusions `mapstructure:"exclusions"`
}

type Dimming

type Dimming struct {
	Enabled            *bool               `mapstructure:"enabled" validate:"required"`
	DimmableComponents []DimmableComponent `mapstructure:"dimmableComponents" validate:"required"`
	Controller         Controller          `mapstructure:"controller" validate:"required"`
	Profiler           Profiler            `mapstructure:"profiler" validate:"required"`
}

type Exclusions

type Exclusions struct {
	Method    *string `mapstructure:"method" validate:"required"`
	Substring *string `mapstructure:"substring" validate:"required"`
}

type InfluxDB

type InfluxDB struct {
	Addr   *string `mapstructure:"addr" validate:"required"`
	Token  *string `mapstructure:"token" validate:"required"`
	Org    *string `mapstructure:"org" validate:"required"`
	Bucket *string `mapstructure:"bucket" validate:"required"`
}

type Logging

type Logging struct {
	Driver   *string  `mapstructure:"driver" validate:"oneof=noop stdout influxdb"`
	InfluxDB InfluxDB `mapstructure:"influxdb" validate:"required_if=Driver influxdb"`
}

type MatchableMethod

type MatchableMethod struct {
	ShouldMatchAll *bool `mapstructure:"shouldMatchAll" validate:"required_without=Method"`
	// Method must be set if ShouldMatchAll is false. If ShouldMatchAll is true,
	// Method is ignored.
	Method *string `mapstructure:"method" validate:"required_without=ShouldMatchAll required_if=ShouldMatchAll false"`
}

type Probabilities

type Probabilities struct {
	High           *float64 `mapstructure:"high" validate:"required"`
	HighMultiplier *float64 `mapstructure:"highMultiplier" validate:"required"`
	Low            *float64 `mapstructure:"low" validate:"required"`
	LowMultiplier  *float64 `mapstructure:"lowMultiplier" validate:"required"`
}

type Profiler

type Profiler struct {
	Enabled       *bool         `mapstructure:"enabled" validate:"required"`
	SessionCookie *string       `mapstructure:"sessionCookie" validate:"required"`
	InfluxDB      InfluxDB      `mapstructure:"influxdb" validate:"required"`
	Redis         Redis         `mapstructure:"redis" validate:"required"`
	Probabilities Probabilities `mapstructure:"probabilities" validate:"required"`
}

type Redis

type Redis struct {
	Addr         *string `mapstructure:"addr" validate:"required"`
	Password     *string `mapstructure:"password" validate:"required"`
	PrioritiesDB *int    `mapstructure:"prioritiesDB" validate:"required"`
	QueueDB      *int    `mapstructure:"queueDB" validate:"required"`
}

Jump to

Keyboard shortcuts

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