config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package config centralizes the parsing of application configuration

Index

Constants

View Source
const (
	FileParamStore  = "file"
	RedisParamStore = "redis"
)

Supported network parameter store types

View Source
const (
	FileSeriesStore          = FileParamStore
	ElasticsearchSeriesStore = "elasticsearch"
)

Supported series store types

Variables

This section is empty.

Functions

func Getenv

func Getenv(env, fallback string) string

Getenv is useful for retrieving the value of an env var with a default

func Present added in v0.4.0

func Present(list []string, element string) bool

Present returns true if the given element is in the given list, false if not

Types

type Config

type Config struct {
	AppVersion string
	Logger     LoggerParams
	ML         MLParams
	Series     SeriesParams
}

Config holds all the configuration for the app

func New

func New() (*Config, error)

New generates a Config object populated with values from the environment

type Kafka

type Kafka struct {
	Brokers []string
	GroupID string
	Topic   string
}

Kafka holds the necessary configuration to set up the connection to a Kafka cluster

type LoggerParams

type LoggerParams struct {
	ArtifactID  string
	Level       string
	ServiceName string
}

LoggerParams holds the necessary configuration to initialize the logger

type MLParams

type MLParams struct {
	Generations int // Number of cycles to run the genetic algorithm for in search of the optimal net params
	MaxEpoch    int
	MaxHLayers  int // Maximum starting number of hidden layers (the genetic algorithm can surpass it)
	MinHLayers  int // Minimum starting number of hidden layers (the genetic algorithm can go down to 1)
	StoreType   string
	StoreParams map[string]interface{}
	TestSet     float32
	Tolerance   float32
	Variations  int // Number of different network configs to evaluate in each generation of the genetic algorithm
}

MLParams holds the parameters that determine how the ML package will behave and how it will store its data

func (*MLParams) Check added in v0.4.0

func (mlParams *MLParams) Check() error

Check will return an error if any of the machine learning params have semantically incorrect values

type SeriesParams

type SeriesParams struct {
	FailLimit   int
	Source      Kafka
	StoreType   string
	StoreParams map[string]interface{}
	StorePass   string
	StoreUser   string
}

SeriesParams holds the parameters that determine how the series package will behave and how it will store its data

func (*SeriesParams) Check added in v0.4.0

func (seriesParams *SeriesParams) Check() error

Check will return an error if any of the series params have semantically incorrect values

Jump to

Keyboard shortcuts

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