config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoundUpDuration

func RoundUpDuration(toRound, roundOn time.Duration) time.Duration

Types

type BuildInfo added in v0.4.0

type BuildInfo struct {
	Version           string
	Commit            string
	Date              string
	GoVersion         string
	PythonVersion     string
	GoreleaserVersion string
	// contains filtered or unexported fields
}

func NewBuildInfo added in v0.4.0

func NewBuildInfo(version, commit, date, goVersion, pythonVersion, goreleaserVersion string) *BuildInfo

func (*BuildInfo) Collect added in v0.4.0

func (b *BuildInfo) Collect(ch chan<- prometheus.Metric)

func (*BuildInfo) Describe added in v0.4.0

func (b *BuildInfo) Describe(ch chan<- *prometheus.Desc)

type Config

type Config struct {
	Schedule string `envconfig:"SCHEDULE" default:"@every 120m"`
	Timezone string `envconfig:"TIMEZONE" default:"America/Vancouver"`

	PromExporterAddr string `envconfig:"PROM_EXPORTER_ADDR" default:":9999"`

	PromClientURL                string `envconfig:"PROM_CLIENT_URL"`
	PromClientTLSCA              string `envconfig:"PROM_CLIENT_TLS_CA"`
	PromClientTLSCert            string `envconfig:"PROM_CLIENT_TLS_CERT"`
	PromClientTLSKey             string `envconfig:"PROM_CLIENT_TLS_KEY"`
	PromClientInsecureSkipVerify bool   `envconfig:"PROM_CLIENT_INSECURE_SKIP_VERIFY"`

	WatchList *WatchList `envconfig:"WATCH_LIST"`
	Models    []string   `envconfig:"MODELS" default:"Prophet"`

	DefaultChunkSize time.Duration `envconfig:"DEFAULT_CHUNK_SIZE" default:"120m"`
	RollingWindow    time.Duration `envconfig:"ROLLING_WINDOW" default:"72h"`

	GRPCServerAddress      string        `envconfig:"GRPC_SERVER_ADDRESS" default:"localhost:18443"`
	GRPCRootCA             string        `envconfig:"GRPC_ROOT_CA"`
	GRPCServerCert         string        `envconfig:"GRPC_SERVER_CERT"`
	GRPCServerKey          string        `envconfig:"GRPC_SERVER_KEY"`
	GRPCClientCert         string        `envconfig:"GRPC_CLIENT_CERT"`
	GRPCClientKey          string        `envconfig:"GRPC_CLIENT_KEY"`
	GRPCClientMaxRetries   uint          `envconfig:"" default:"3"`
	GRPCClientRetryBackoff time.Duration `envconfig:"" default:"2s"`
	// contains filtered or unexported fields
}

func New

func New(lg *zap.Logger) *Config

func (*Config) ChunkSize

func (c *Config) ChunkSize() time.Duration

func (*Config) GRPCClientCreds added in v0.5.0

func (c *Config) GRPCClientCreds() (credentials.TransportCredentials, error)

func (*Config) Load

func (c *Config) Load() error

func (*Config) Location

func (c *Config) Location() *time.Location

func (*Config) PromClientTLS

func (c *Config) PromClientTLS() (*tls.Config, error)

type WatchList added in v0.4.0

type WatchList struct {
	// contains filtered or unexported fields
}

WatchList can decode either a YAML config or a comma separated list

  • YAML config has a list of metric queries and model names for each everyone of them. When using YAML, MODELS (config.Models) env var is not needed.
  • comma separated list doesn't specify model names for each metric query, models names come from MODELS (config.Models) env var and it will be set with fillEmpty method. When using comma separated list, MODELS env var is required

func (*WatchList) Decode added in v0.4.0

func (w *WatchList) Decode(value string) error

Decode either a YAML config or a comma separated list for backward compatibility

WATCH_LIST comma separated list or inline yaml sensehat_temperature,sensehat_humidity,sensehat_pressure {sensehat_temperature: [Prophet, LSTM], sensehat_humidity: [Prophet], sensehat_pressure: [LSTM]}

func (*WatchList) List added in v0.4.0

func (w *WatchList) List() map[string][]string

Jump to

Keyboard shortcuts

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