config

package
v0.0.0-...-82364ab Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvSettings

type EnvSettings struct {
	EnvHTTPListenPort  int    `envconfig:"HTTP_PORT" default:"8080"`
	EnvLogLevel        string `envconfig:"LOG_LEVEL" default:"info"`
	EnvStorageFilePath string `envconfig:"STORAGE_FILEPATH" default:"jobtome.dat"`
}

EnvSettings reads settings from environment variables.

func NewEnvSettings

func NewEnvSettings(prefix string) (EnvSettings, error)

NewEnvSettings returns EnvSettings initialized from environment variables. `prefix` allows to add an extra prefix that needs to be used with all env var names.

func (EnvSettings) HTTPPort

func (es EnvSettings) HTTPPort() int

HTTPPort returns a port number to listening for incoming HTTP connections.

func (EnvSettings) LogLevel

func (es EnvSettings) LogLevel() string

LogLevel returns a logging level.

func (EnvSettings) StorageFilePath

func (es EnvSettings) StorageFilePath() string

StorageFilePath returns path to the file to use as persisted storage.

Jump to

Keyboard shortcuts

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