utils

package module
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintAllEnv

func PrintAllEnv(logger logrus.FieldLogger)

PrintAllEnv prints all envs

Types

type EnvVar

type EnvVar string

EnvVar provides API for access to env variable

func (EnvVar) GetBooleanOrDefault

func (v EnvVar) GetBooleanOrDefault(defaultValue bool) bool

GetBooleanOrDefault returns env value as string or if env variable have not a value returns default value

func (EnvVar) GetIntOrDefault

func (v EnvVar) GetIntOrDefault(defaultValue int) int

GetIntOrDefault returns env value as string or if env variable have not a value returns default value

func (EnvVar) GetOrDefaultDuration

func (v EnvVar) GetOrDefaultDuration(defaultValue time.Duration) time.Duration

GetOrDefaultDuration returns env value as duration or if env variable have not a value returns default value

func (EnvVar) GetStringListValueOrDefault

func (v EnvVar) GetStringListValueOrDefault(defaultValues ...string) []string

GetStringListValueOrDefault returns list of string separated by space or if env variable have not a value returns default value

func (EnvVar) GetStringOrDefault

func (v EnvVar) GetStringOrDefault(defaultValue string) string

GetStringOrDefault returns env value as string or if env variable have not a value returns default value

func (EnvVar) Name

func (v EnvVar) Name() string

Name returns emv variable name

func (EnvVar) Set

func (v EnvVar) Set(value interface{})

Set sets value for env variable

func (EnvVar) String

func (v EnvVar) String() string

func (EnvVar) StringValue

func (v EnvVar) StringValue() string

StringValue returns value of env variable as string

type Operation

type Operation interface {
	//Run executes operation
	Run()
	//Wait waits for operation completed
	Wait()
}

Operation means an object which can be executed

func NewSingleAsyncOperation

func NewSingleAsyncOperation(body func()) Operation

NewSingleAsyncOperation creates an operation which should be invoked once by run period. Can be used in cases where required the last run.

Directories

Path Synopsis
Package caddyfile provides API for creating and editing caddyfile
Package caddyfile provides API for creating and editing caddyfile

Jump to

Keyboard shortcuts

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