config

package
v0.0.0-...-0fe9a67 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 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"`
	EnvStorageAddr    string `envconfig:"STORAGE_ADDR" default:"0.0.0.0:5432"`
	EnvStoragePwd     string `envconfig:"STORAGE_PWD"`
}

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) StorageAddr

func (es EnvSettings) StorageAddr() string

StorageAddr returns address of the main persistence storage.

func (EnvSettings) StoragePwd

func (es EnvSettings) StoragePwd() string

Jump to

Keyboard shortcuts

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