object

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT Imports: 13 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStringMapToString

func ConvertStringMapToString(m *StringMap, separate string) string

func GetHashMapKV

func GetHashMapKV(maps StringMap) (keys []string, values []interface{})

func GetJoinedWithKSort

func GetJoinedWithKSort(params *StringMap) string

func GetStringMapKV

func GetStringMapKV(maps StringMap) (keys []string, values []string)

func HashMapToStructure

func HashMapToStructure(mapObj *HashMap, obj interface{}) (err error)

func InHash

func InHash(val interface{}, hash *HashMap) (exists bool, key string)

------------------------------- Search --------------------------------------------

func InStringMap

func InStringMap(val string, maps *StringMap) (exists bool, keys []string)

func JsonDecode

func JsonDecode(data []byte, v interface{}) error

func JsonEncode

func JsonEncode(v interface{}) (string, error)

func JsonEscape

func JsonEscape(str string) (string, error)

func LoadObjectFromFile

func LoadObjectFromFile(jsonPath string, obj interface{}) (err error)

func Map2Xml

func Map2Xml(obj *HashMap, isSub bool) (strXML string)

func OpenYMLFile

func OpenYMLFile(yamlFile string, yamlObject interface{}) (err error)

func SaveObjectToFile

func SaveObjectToFile(obj interface{}, filePath string, perm fs.FileMode) (err error)

func SaveYMLFile

func SaveYMLFile(yamlObject interface{}, savePath string, perm fs.FileMode) (err error)

func Str2Xml

func Str2Xml(in string) string

func StringMap2Xml

func StringMap2Xml(obj *StringMap) (strXML string)

func Xml2HashMap

func Xml2HashMap(b []byte) (m map[string]interface{}, err error)

Types

type HashMap

type HashMap map[string]interface{}

func FilterEmptyHashMap

func FilterEmptyHashMap(mapData *HashMap) (filteredMap *HashMap)

------------------------------- Filter --------------------------------------------

func MergeHashMap

func MergeHashMap(toMap *HashMap, subMaps ...*HashMap) *HashMap

------------------------------- Merge --------------------------------------------

func ReplaceHashMapRecursive

func ReplaceHashMapRecursive(toMap *HashMap, subMaps ...*HashMap) *HashMap

------------------------------- Replace --------------------------------------------

func StructToHashMap

func StructToHashMap(obj interface{}) (newMap *HashMap, err error)

func StructToHashMapWithXML

func StructToHashMapWithXML(obj interface{}) (newMap *HashMap, err error)

func Xml2Map

func Xml2Map(b []byte) (m HashMap, err error)

func (*HashMap) Get

func (m *HashMap) Get(key string) interface{}

type StringMap

type StringMap map[string]string

func FilterEmptyStringMap

func FilterEmptyStringMap(mapData *StringMap) (filteredMap *StringMap)

------------------------------- Filter --------------------------------------------

func HashMapToStringMap

func HashMapToStringMap(obj *HashMap) (newMap *StringMap, err error)

func MergeStringMap

func MergeStringMap(toStringMap *StringMap, subStringMaps ...*StringMap) *StringMap

------------------------------- Merge --------------------------------------------

func ReplaceStringMapRecursive

func ReplaceStringMapRecursive(toMap *StringMap, subMaps ...*StringMap) *StringMap

------------------------------- Replace --------------------------------------------

func StructToStringMap

func StructToStringMap(obj interface{}) (*StringMap, error)

func StructToStringMapWithTag

func StructToStringMapWithTag(obj interface{}, tag string) (newMap *StringMap, err error)

Jump to

Keyboard shortcuts

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