flags

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(name string, value interface{}, overrides []Override) interface{}

Default returns default value for param's name based on default value and overrides

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 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 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 string) *Flag

New creates new instance of Flag

func (*Flag) Default

func (f *Flag) Default(value interface{}) *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) Name

func (f *Flag) Name(name string) *Flag

Name defines name 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) 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

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