tools

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 11 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 GetID

func GetID(r *http.Request) string

GetID return ID of URL (first section between two slashes)

func IncludesString

func IncludesString(array []string, lookup string) bool

IncludesString checks in an array includes given string

func IsRoot

func IsRoot(r *http.Request) bool

IsRoot checks if current path is root (empty or only trailing slash)

func LookupEnvBool

func LookupEnvBool(key string, defaultValue bool) bool

LookupEnvBool search for given key in environment as bool

func LookupEnvFloat64 added in v2.0.2

func LookupEnvFloat64(key string, defaultValue float64) float64

LookupEnvFloat64 search for given key in environment as float64

func LookupEnvInt

func LookupEnvInt(key string, defaultValue int) int

LookupEnvInt search for given key in environment as int

func LookupEnvString

func LookupEnvString(key, defaultValue string) string

LookupEnvString search for given key in environment

func LookupEnvUint

func LookupEnvUint(key string, defaultValue uint) uint

LookupEnvUint search for given key in environment as uint

func Sha1

func Sha1(o interface{}) string

Sha1 return SHA1 fingerprint

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 NewFlag

func NewFlag(prefix, docPrefix string) *Flag

NewFlag creates new instance of Flag

func (*Flag) Default

func (f *Flag) Default(defaultValue 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 added in v2.0.2

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

Jump to

Keyboard shortcuts

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