Documentation ¶
Index ¶
- func CleanPath(path string) string
- func EnvBool(name string, def bool) bool
- func FindAnyWith[T any](items []T, matchFn func(item *T) bool) *T
- func FindInSlice[T comparable](items []T, x T) int
- func FromPbJson[T proto.Message](reader io.Reader, obj T) error
- func FromPbToYaml[T proto.Message](writer io.Writer, obj T) error
- func FromYamlToPb[T proto.Message](reader io.Reader, obj T) error
- func Int64(max int64) int64
- func Introspect(v interface{}) string
- func IsEmptyString(s string) bool
- func MapStruct[T any](source interface{}, dest *T) error
- func NewUniqueId() string
- func SafelyGetValue[T any](target *T) T
- func ToPbJson[T proto.Message](obj T, indent string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvBool ¶
EnvBool looks up environment variable by name and converts the string value to bool. It returns default value if env does not exist or conversion to bool fails
func FindAnyWith ¶
func FindInSlice ¶
func FindInSlice[T comparable](items []T, x T) int
FindInSlice finds an item in a slice and returns the index. It will return -1 if not found
func Introspect ¶
func Introspect(v interface{}) string
Serialize an interface using JSON or return error string
func IsEmptyString ¶
func NewUniqueId ¶
func NewUniqueId() string
func SafelyGetValue ¶
func SafelyGetValue[T any](target *T) T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.