structs

package
v0.0.0-...-3b54ddd Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeTag

func EncodeTag(tag string) (data map[string]string)

func Interface2Bool

func Interface2Bool(value interface{}, strict bool) (v bool, ok bool)

func Interface2Float

func Interface2Float(value interface{}, strict bool) (v float64, ok bool)

func Interface2Int

func Interface2Int(value interface{}, strict bool) (v int64, ok bool)

func Interface2String

func Interface2String(value interface{}, strict bool) (v string, ok bool)

func Interface2StringWithType

func Interface2StringWithType(value interface{}, strict bool) (v string, ok bool)

func Interface2UInt

func Interface2UInt(value interface{}, strict bool) (v uint64, ok bool)

func Map2Struct

func Map2Struct(m map[string]interface{}, v interface{}, useTag string) error

将map将转换为struct,支持组合与嵌套

func Map2StructValue

func Map2StructValue(m map[string]interface{}, v reflect.Value, useTag string) error

func MapString2Struct

func MapString2Struct(mapper map[string]string, obj interface{}, useTag string) (err error)

func Struct2MapString

func Struct2MapString(v interface{}, useTag string) (map[string]string, error)

将结构体转换为map[string]string{},仅支持组合和普通一层结构体,对第二层结构体会直接忽略

Types

This section is empty.

Jump to

Keyboard shortcuts

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