Documentation
¶
Index ¶
- func AnyNotNil(values ...interface{}) bool
- func GetBool(value bool, defaultValue bool) bool
- func GetFloat(values ...float64) float64
- func GetFloatPtr(values ...*float64) *float64
- func GetIndexOrDefault[T any](nodes []T, index int, defaultItem T) T
- func GetInt(values ...int) int
- func GetObjectKeyOrDefault[T any](obj *map[string]T, key string, defaultItem T) T
- func GetPtr[T any](values ...*T) *T
- func GetString(values ...string) string
- func GetValue(values ...interface{}) interface{}
- func GetZeroIfNil[T any](f *T, zeroValue T) T
- func ImplodeMapStrings[V any](mapKeys map[string]V) string
- func MapKeysToStringSlice[T any](maps ...*map[string]T) []string
- func MarshalJsonToString(data interface{}) string
- func MaxFloatPtr[T Number](a ...*T) *T
- func MaxInt(a ...int) int
- func MergeSlicePtrs[T any](slices ...*[]T) *[]T
- func MinFloatPtr[T Number](a ...*T) *T
- func MinInt(a ...int) int
- func MultiplyIfPossibleAndNotMultipleOfFloat64(a *float64, b *float64) *float64
- func RegexMatchNamedCaptureGroups(r *regexp.Regexp, str string) map[string]string
- func Round(x, unit float64) float64
- func SafeMarshalListToJsonList(data *[]interface{}) []string
- func UnmarshalJsonStringToMap(data string) interface{}
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFloatPtr ¶ added in v0.1.1
func GetIndexOrDefault ¶ added in v0.2.0
func GetObjectKeyOrDefault ¶ added in v0.2.0
GetObjectKeyOrDefault returns the value for the given key in the map or the defaultItem if the key does not exist or the map itself is nil
func GetZeroIfNil ¶ added in v0.2.0
func GetZeroIfNil[T any](f *T, zeroValue T) T
func ImplodeMapStrings ¶ added in v0.2.0
func MapKeysToStringSlice ¶ added in v0.2.0
Extract the keys from a map[string]T as a []string
func MarshalJsonToString ¶ added in v0.2.0
func MarshalJsonToString(data interface{}) string
Marshal Data to a string in error cases the string is empty and the error is blackholed
func MaxFloatPtr ¶ added in v0.2.0
func MaxFloatPtr[T Number](a ...*T) *T
func MergeSlicePtrs ¶ added in v0.2.0
func MergeSlicePtrs[T any](slices ...*[]T) *[]T
func MinFloatPtr ¶ added in v0.2.0
func MinFloatPtr[T Number](a ...*T) *T
MinFloatPtr returns the lowest value float pointer
func MultiplyIfPossibleAndNotMultipleOfFloat64 ¶ added in v0.2.1
func RegexMatchNamedCaptureGroups ¶ added in v0.2.0
Regex to named capture groups
func SafeMarshalListToJsonList ¶ added in v0.2.0
func SafeMarshalListToJsonList(data *[]interface{}) []string
func UnmarshalJsonStringToMap ¶ added in v0.2.0
func UnmarshalJsonStringToMap(data string) interface{}
Unmarshal a string to a map
Types ¶
type Number ¶ added in v0.2.1
type Number interface {
constraints.Integer | constraints.Float
}
Click to show internal directories.
Click to hide internal directories.