flags

package
v4.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstLowerCase

func FirstLowerCase(s string) string

FirstLowerCase change first letter to lowerCase

func FirstUpperCase

func FirstUpperCase(s string) string

FirstUpperCase change first letter to UpperCase

func LookupEnvBool

func LookupEnvBool(key string, value bool) bool

LookupEnvBool search for given key in environment as bool

func LookupEnvFloat64

func LookupEnvFloat64(key string, value float64) float64

LookupEnvFloat64 search for given key in environment as float64

func LookupEnvInt

func LookupEnvInt(key string, value int) int

LookupEnvInt search for given key in environment as int

func LookupEnvInt64 added in v4.22.3

func LookupEnvInt64(key string, value int64) int64

LookupEnvInt64 search for given key in environment as int64

func LookupEnvString

func LookupEnvString(key, value string) string

LookupEnvString search for given key in environment

func LookupEnvUint

func LookupEnvUint(key string, value uint) uint

LookupEnvUint search for given key in environment as uint

func LookupEnvUint64 added in v4.22.2

func LookupEnvUint64(key string, value uint64) uint64

LookupEnvUint64 search for given key in environment as uint64

func SnakeCase

func SnakeCase(s string) string

SnakeCase transform camelCase to snake_case

Types

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

Flag describe a flag

func New

func New(prefix, docPrefix, name string) Flag

New creates new instance of Flag

func (Flag) Default

func (f Flag) Default(value interface{}, overrides []Override) Flag

Default defines default value of Flag

func (Flag) Label

func (f Flag) Label(format string, a ...interface{}) Flag

Label defines label of Flag

func (Flag) ToBool

func (f Flag) ToBool(fs *flag.FlagSet) *bool

ToBool build Flag Set for bool

func (Flag) ToFloat64

func (f Flag) ToFloat64(fs *flag.FlagSet) *float64

ToFloat64 build Flag Set for float64

func (Flag) ToInt

func (f Flag) ToInt(fs *flag.FlagSet) *int

ToInt build Flag Set for int

func (Flag) ToInt64 added in v4.22.3

func (f Flag) ToInt64(fs *flag.FlagSet) *int64

ToInt64 build Flag Set for int64

func (Flag) ToString

func (f Flag) ToString(fs *flag.FlagSet) *string

ToString build Flag Set for string

func (Flag) ToUint

func (f Flag) ToUint(fs *flag.FlagSet) *uint

ToUint build Flag Set for uint

func (Flag) ToUint64 added in v4.22.2

func (f Flag) ToUint64(fs *flag.FlagSet) *uint64

ToUint64 build Flag Set for uint64

type Override

type Override struct {
	// contains filtered or unexported fields
}

Override is an override of default value

func NewOverride

func NewOverride(name string, value interface{}) Override

NewOverride create a default override value

Jump to

Keyboard shortcuts

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