utils

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, needle string) bool

func DeepSearchInMap

func DeepSearchInMap(m map[string]interface{}, key string, keyDelimiter string) map[string]interface{}

func ExpandInlineKeyInLinkedHMap

func ExpandInlineKeyInLinkedHMap(hMap *linkedhashmap.Map, delim string) *linkedhashmap.Map

func GetStructFullname

func GetStructFullname(val interface{}) string

func GetStructShortName

func GetStructShortName(val interface{}) string

func LinkedHMap

func LinkedHMap(items ...MapItem) *linkedhashmap.Map

func LinkedHMapToMapStr

func LinkedHMapToMapStr(hMap *linkedhashmap.Map) map[string]interface{}

func MergeCaseInsensitiveMaps

func MergeCaseInsensitiveMaps(src, tgt map[string]interface{}) map[string]interface{}

MergeCaseInsensitiveMaps merges two maps

func MergeLinkedHMap

func MergeLinkedHMap(dst *linkedhashmap.Map, src *linkedhashmap.Map)

func PrependString

func PrependString(slice []string, e string) []string

func ReplacePlaceholder

func ReplacePlaceholder(val interface{}) (interface{}, error)

ReplacePlaceholder Replaces a value in placeholder format by new value configured in environment variable.

Placeholder format: ${EXAMPLE_VAR}

func SliceFromCommaString

func SliceFromCommaString(str string) []string

func Time2Ms

func Time2Ms(t time.Time) int64

func YamlMapSliceToLinkedHMap

func YamlMapSliceToLinkedHMap(ms yaml.MapSlice) *linkedhashmap.Map

Types

type MapItem

type MapItem struct {
	Key   interface{}
	Value interface{}
}

func NewMapItem

func NewMapItem(key interface{}, value interface{}) MapItem

Jump to

Keyboard shortcuts

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