configreader

package
v0.0.0-...-3e9bda6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PoetrydbBaseUrl     string `envconfig:"POETRYDB_BASE_URL" required:"true"`
	PoetrydbHttpTimeout int    `envconfig:"POETRYDB_HTTP_TIMEOUT" required:"true"`
}

Config holds configuration data.

func ReadEnv

func ReadEnv() (*Config, error)

ReadEnv reads envionment variables into Config struct.

type EnvConfig

type EnvConfig interface {
	Process(prefix string, spec interface{}) error
}

EnvConfig is an interface that defines the functions we use from envconfig package. It enables mocking this dependency in unit testing.

type GoDotEnv

type GoDotEnv interface {
	Load(filenames ...string) (err error)
}

GoDotEnv is an interface that defines the functions we use from godotenv package. It enables mocking this dependency in unit testing.

Jump to

Keyboard shortcuts

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