utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeByTag added in v1.0.0

func DecodeByTag(input interface{}, output interface{}, tag string) error

func DuplicateString added in v0.0.6

func DuplicateString(s []string) (result []string)

DuplicateString 去重

func GetValueByTag added in v0.0.6

func GetValueByTag(obj interface{}, tag string, tagValue string) interface{}

GetValueByTag 获取结构体指针中的指定字段值

func Map2SliceE added in v0.0.6

func Map2SliceE(i interface{}) (ks interface{}, vs interface{}, err error)

Map2SliceE converts keys and values of map to slice in unspecified order with error.

func SetValuesByTag added in v0.0.6

func SetValuesByTag(obj interface{}, tag string, values map[string]interface{})

func StringSlice2Map added in v0.0.6

func StringSlice2Map(s []string) (res map[string]interface{})

StringSlice2Map 将字符串slice转为map

func Struct2Map added in v0.0.6

func Struct2Map(obj interface{}, tag string) map[string]interface{}

Struct2Map 将结构体转为map,tag指定的字段值

func Struct2MapFilterByKeys added in v1.0.0

func Struct2MapFilterByKeys(m interface{}, tagName string, keys []string) map[string]interface{}

Struct2MapFilterByKeys 将结构体指针转为map,tag指定的字段值, keys指定要转换的字段

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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