utils

package
v0.12.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDNS

func CheckDNS(domain string) error

CheckDNS FIXME ...

func CheckNetwork

func CheckNetwork(host, port string, timeout time.Duration) error

CheckNetwork FIXME ...

func GatherCallFrames

func GatherCallFrames(delta int) string

GatherCallFrames FIXME ...

func GetEncodedToken

func GetEncodedToken(username string, password string) string

GetEncodedToken FIXME ...

func ResolvePort

func ResolvePort(port string, schema string) (string, error)

ResolvePort FIXME ...

func StrToBoolOr added in v0.12.0

func StrToBoolOr(text string, defaultValue bool) (bool, error)

StrToBoolOr Return defaultValue if text is empty, or try to convert it to bool

func StrToDurationOr

func StrToDurationOr(text string, defaultValue time.Duration) (time.Duration, error)

StrToDurationOr Return defaultValue if text is empty, or try to convert it to time.Duration

func StrToIntOr

func StrToIntOr(text string, defaultValue int) (int, error)

StrToIntOr Return defaultValue if text is empty, or try to convert it to int

func StringsContains added in v0.12.0

func StringsContains(slice []string, target string) bool

StringsContains checks if `source` String Slice contains `target` string

func StringsUniq added in v0.12.0

func StringsUniq(source []string) []string

StringsUniq returns a new String Slice contains deduped elements from `source`

func WalkFields added in v0.12.0

func WalkFields(t reflect.Type, filter func(field *reflect.StructField) bool) (f []reflect.StructField)

WalkFields get the field data by tag

Types

This section is empty.

Jump to

Keyboard shortcuts

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