env

package
v0.0.0-...-471a3bb Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(config *Config) error

Initialize initializes the paths used in the application.

func ResolveDatasetPath

func ResolveDatasetPath(datasetID string) string

ResolveDatasetPath returns the path for a dataset folder

func ResolvePipelineD3MPath

func ResolvePipelineD3MPath(pipelineID string) string

ResolvePipelineD3MPath returns the path pickled fitted pipeline.

func ResolvePipelineJSONPath

func ResolvePipelineJSONPath(pipelineID string) string

ResolvePipelineJSONPath returns the path to the json file representing the pipeline.

func ResolvePipelinePath

func ResolvePipelinePath(pipelineID string) string

ResolvePipelinePath returns the path to the folder containing the pipeline info.

func ResolvePredictionPath

func ResolvePredictionPath(predictionID string) string

ResolvePredictionPath returns the path for a prediction folder

func ResolveProblemPath

func ResolveProblemPath(pipelineID string) string

ResolveProblemPath returns the path to the file representing the problem for the pipeline.

Types

type Config

type Config struct {
	AppPort                 string  `env:"PORT" envDefault:"8080"`
	BatchSize               int     `env:"BATCH_SIZE" envDefault:"100"`
	BatchSizeIncreaseFactor float64 `env:"BATCH_SIZE_INCREASE_FACTOR" envDefault:"1.2"`
	BatchSizeDecreaseFactor float64 `env:"BATCH_SIZE_DECREASE_FACTOR" envDefault:"0.9"`
	ClearDataset            bool    `env:"CLEAR_DATASET" envDefault:"true"`
	D3MOutputDir            string  `env:"D3MOUTPUTDIR" envDefault:"outputs"`
	D3MStaticDir            string  `env:"D3MSTATICDIR" envDefault:"/data/static_resources"`
	DatasetDir              string  `env:"DATASET_DIR" envDefault:"datasets"`
	PipelineD3M             string  `env:"PIPELINE_D3M" envDefault:"pipeline.d3m"`
	PipelineDir             string  `env:"PIPELINE_DIR" envDefault:"pipelines"`
	PipelineJSON            string  `env:"PIPELINE_JSON" envDefault:"pipeline.json"`
	PredictionDir           string  `env:"PREDICTION_DIR" envDefault:"predictions"`
	ProblemFile             string  `env:"PROBLEM_FILE" envDefault:"problemDoc.json"`
	VerboseError            bool    `env:"VERBOSE_ERROR" envDefault:"false"`
}

Config represents the application configuration state loaded from env vars.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads the config from the environment if necessary and returns a copy.

Jump to

Keyboard shortcuts

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