extutil

package
v1.8.22 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 5 Imported by: 46

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

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 MaskString added in v1.7.18

func MaskString(s string, search string, remaining int) string

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 ToBool added in v1.7.11

func ToBool(val interface{}) bool

func ToInt added in v1.7.11

func ToInt(val interface{}) int

func ToInt32 added in v1.7.19

func ToInt32(val interface{}) int32

func ToInt64 added in v1.7.11

func ToInt64(val interface{}) int64

func ToKeyValue added in v1.7.11

func ToKeyValue(config map[string]interface{}, configName string) (map[string]string, error)

func ToString added in v1.7.11

func ToString(val interface{}) string

func ToStringArray added in v1.7.13

func ToStringArray(s interface{}) []string

func ToUInt added in v1.7.12

func ToUInt(val interface{}) uint

func ToUInt64 added in v1.7.11

func ToUInt64(val interface{}) uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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