Documentation ¶
Index ¶
- Variables
- type EnvUtils
- func (EnvUtils) GetBool(env string) (value bool, err error)
- func (EnvUtils) GetInt(env string) (value int, err error)
- func (EnvUtils) GetOrDefaultBool(env string, defaultValue bool) (value bool)
- func (EnvUtils) GetOrDefaultInt(env string, defaultValue int) (value int)
- func (EnvUtils) GetOrDefaultSecond(env string, defaultValue time.Duration) (value time.Duration)
- func (EnvUtils) GetOrDefaultString(env, defaultValue string) (value string)
- func (EnvUtils) GetSecond(env string) (value time.Duration, err error)
- func (EnvUtils) GetString(env string) (value string, err error)
- type SliceUtils
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEnvironmentVariableNotSet environment variable not set ErrEnvironmentVariableNotSet = errors.New("environment variable not set") )
Functions ¶
This section is empty.
Types ¶
type EnvUtils ¶
type EnvUtils struct{}
EnvUtils is an empty structure that is prepared only for creating methods.
var Env EnvUtils
Env is an entity that allows the methods of IntSliceUtils to be executed from outside the package without initializing IntSliceUtils.
func (EnvUtils) GetBool ¶ added in v1.1.0
GetBool returns the value of the environment variable `env` if it is set, or the error if it is not set or invalid.
func (EnvUtils) GetInt ¶ added in v1.1.0
GetInt returns the value of the environment variable `env` if it is set, or the error if it is not set or invalid.
func (EnvUtils) GetOrDefaultBool ¶ added in v1.1.0
GetOrDefaultBool returns the value of the environment variable `env` if it is set, or `defaultValue` if it is not set.
func (EnvUtils) GetOrDefaultInt ¶ added in v1.1.0
GetOrDefaultInt returns the value of the environment variable `env` if it is set, or `defaultValue` if it is not set.
func (EnvUtils) GetOrDefaultSecond ¶ added in v1.1.0
GetOrDefaultSecond returns the value of the environment variable `env` if it is set, or `defaultValue` if it is not set.
func (EnvUtils) GetOrDefaultString ¶ added in v1.1.0
GetOrDefaultString returns the value of the environment variable `env` if it is set, or `defaultValue` if it is not set.
type SliceUtils ¶
type SliceUtils struct{}
SliceUtils is an empty structure that is prepared only for creating methods.
var Slice SliceUtils
Slice is an entity that allows the methods of IntSliceUtils to be executed from outside the package without initializing IntSliceUtils.
func (SliceUtils) ContainsInt ¶
func (SliceUtils) ContainsInt(slice []int, value int) bool
ContainsInt returns whether or not the passed slice contains the passed value.
func (SliceUtils) ContainsString ¶
func (SliceUtils) ContainsString(slice []string, value string) bool
ContainsString returns whether or not the passed slice contains the passed value.