Documentation ¶
Overview ¶
Package extutil contains a variety of util functions that were identified as common code duplication. More specialized packages exist for groups of use cases (extlogging and exthttp) for example.
Index ¶
- func JsonMangle[T any](in T) T
- func MaskString(s string, search string, remaining int) string
- func MustHaveValue[T any, K comparable](m map[K]T, key K) T
- func Ptr[T any](val T) *T
- func ToBool(val interface{}) bool
- func ToInt(val interface{}) int
- func ToInt32(val interface{}) int32
- func ToInt64(val interface{}) int64
- func ToKeyValue(config map[string]interface{}, configName string) (map[string]string, error)
- func ToString(val interface{}) string
- func ToStringArray(s interface{}) []string
- func ToUInt(val interface{}) uint
- func ToUInt64(val interface{}) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonMangle ¶ added in v1.7.14
func JsonMangle[T any](in T) T
func MustHaveValue ¶ added in v1.8.15
func MustHaveValue[T any, K comparable](m map[K]T, key K) T
MustHaveValue panics if the given key is not present in the map or the value is nil or empty.
func Ptr ¶
func Ptr[T any](val T) *T
Ptr returns a pointer to the given value. You will find this helpful when desiring to pass a literal value to a function that requires a pointer.
func ToKeyValue ¶ added in v1.7.11
func ToStringArray ¶ added in v1.7.13
func ToStringArray(s interface{}) []string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.