Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilLoader = errors.New("loader cannot be nil") ErrNilDestination = "destination cannot be nil for the given key: %v" ErrEnvironmentVariableNotFound = "environment variable not found: %v" ErrFailedToLoadEnvironmentVariables = errors.New("failed to load environment variables") ErrInvalidDuration = "invalid key '%v' duration value: %v" ErrInvalidInteger = "invalid key '%v' integer value: %v" )
Functions ¶
This section is empty.
Types ¶
type DefaultLoader ¶ added in v0.2.4
type DefaultLoader struct{}
DefaultLoader struct
func NewDefaultLoader ¶ added in v0.2.4
func NewDefaultLoader(loadFn func() error) (*DefaultLoader, error)
NewDefaultLoader creates a new default environment variable loader
func (*DefaultLoader) LoadDurationVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadDurationVariable( key string, dest *time.Duration, ) error
LoadDurationVariable load duration variable from environment variables
func (*DefaultLoader) LoadIntVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadIntVariable(key string, dest *int) error
LoadIntVariable load integer variable from environment variables
func (*DefaultLoader) LoadSecondsVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadSecondsVariable(key string, dest *float64) error
LoadSecondsVariable load duration variable in seconds from environment variables
func (*DefaultLoader) LoadVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadVariable(key string, dest *string) error
LoadVariable load variable from environment variables
type Loader ¶ added in v0.2.4
type Loader interface {
LoadVariable(key string, dest *string) error
LoadDurationVariable(key string, dest *time.Duration) error
LoadSecondsVariable(key string, dest *float64) error
LoadIntVariable(key string, dest *int) error
}
Loader interface for loading environment variables
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the environment logger
func NewLogger ¶
func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)
NewLogger creates a new environment logger
func (*Logger) EnvironmentVariableLoaded ¶
EnvironmentVariableLoaded logs a message when an environment variable is loaded
Click to show internal directories.
Click to hide internal directories.