Documentation
¶
Index ¶
- func DateStrOr(input string, defval time.Time) time.Time
- func DecodePurl(input string) string
- func DirExists(path string) bool
- func DsnHostPortOr(input, defval string) string
- func DsnParaBoolOr(input, key string, defval bool) bool
- func DsnParaOr(input, key, defval string) string
- func DsnPasswordOr(input, defval string) string
- func DsnUserOr(input, defval string) string
- func DurationOr(input string, defval time.Duration) time.Duration
- func ElapsedFunc() func() time.Duration
- func EnvOrDefaultFunc(prefix, envfile string) func(string, string) string
- func Hostname() string
- func HumanDeltaMilisec(delta time.Duration) string
- func HumanDeltaMin(delta time.Duration) string
- func HumanDeltaSec(delta time.Duration) string
- func IsInstalled(cmd string) bool
- func LeftOfFirstOr(input, key, defval string) string
- func MaskDsn(input string) string
- func NoColorCodes(input string) string
- func OsWhich(cmd string) (string, error)
- func PropOr[T any](xc map[string]any, key string, defval T) T
- func RightOfFirstOr(input, key, defval string) string
- func RightOfPrefixOr(input, prefix, defval string) string
- func SetPath(m map[string]any, path string, value any)
- func ShortDigest(input string) string
- func ToBool(input string) bool
- func ToNumOr[T Numeric](input string, defval T) T
- type Numeric
- type SafeIntMap
- type SafeTimeMap
- type ZStd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePurl ¶
func DsnHostPortOr ¶
return host:port from DSN like "docker://user:pwd@pharos.alfa.lan:123/?mi=off"
func DsnParaBoolOr ¶
func DsnPasswordOr ¶
func DurationOr ¶
parse string, return time.Duration or default
func ElapsedFunc ¶
func EnvOrDefaultFunc ¶
return function (closure) thats returns the <prefix>_<name> envvar if it exists, else the default value
func HumanDeltaMilisec ¶
func HumanDeltaMin ¶
return humanized time delat rounded to minuts (not to have like 1h12m1.112521806s)
func HumanDeltaSec ¶
func IsInstalled ¶
return true if given program is installed (found in $PATH)
func LeftOfFirstOr ¶
return left of key of input or default
func NoColorCodes ¶
remove ansi color codes from string (from console output)
func RightOfFirstOr ¶
return right of key of input or default
func RightOfPrefixOr ¶
return right of <prefix> of string or default
func ShortDigest ¶
return left of digest, e.g. "sha256:f85340bf132ae1"
Types ¶
type Numeric ¶
type Numeric interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
~float32 | ~float64
}
numberic types
type SafeIntMap ¶
Int Map
func NewSafeIntMap ¶
func NewSafeIntMap() *SafeIntMap
func (*SafeIntMap) Inc ¶
func (rx *SafeIntMap) Inc(key string) int
func (*SafeIntMap) Sum ¶
func (rx *SafeIntMap) Sum() int
func (*SafeIntMap) Val ¶
func (rx *SafeIntMap) Val(key string) int
Click to show internal directories.
Click to hide internal directories.