Documentation
¶
Index ¶
- Variables
- type DefaultLoader
- func (d *DefaultLoader) LoadDurationVariable(key string) (duration time.Duration, err error)
- func (d *DefaultLoader) LoadIntVariable(key string) (value int, err error)
- func (d *DefaultLoader) LoadSecondsVariable(key string) (seconds float64, err error)
- func (d *DefaultLoader) LoadVariable(key string) (uri string, err error)
- type Loader
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilLoader = errors.New("loader cannot be nil") 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) ( duration time.Duration, err error, )
LoadDurationVariable load duration variable from environment variables
func (*DefaultLoader) LoadIntVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadIntVariable(key string) (value int, err error)
LoadIntVariable load integer variable from environment variables
func (*DefaultLoader) LoadSecondsVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadSecondsVariable(key string) ( seconds float64, err error, )
LoadSecondsVariable load duration variable in seconds from environment variables
func (*DefaultLoader) LoadVariable ¶ added in v0.2.4
func (d *DefaultLoader) LoadVariable(key string) (uri string, err error)
LoadVariable load variable from environment variables
type Loader ¶ added in v0.2.4
type Loader interface {
LoadVariable(key string) (uri string, err error)
LoadDurationVariable(key string) (duration time.Duration, err error)
LoadSecondsVariable(key string) (seconds float64, err error)
LoadIntVariable(key string) (value int, err error)
}
Loader interface for loading environment variables
Click to show internal directories.
Click to hide internal directories.