pkg

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToStr

func ByteToStr(b []byte) string

ByteToStr 高效转换,避免内存拷贝,

func IsBaseType

func IsBaseType(v interface{}) bool

func JsonDumps

func JsonDumps(m interface{}) (string, error)

func JsonLoads

func JsonLoads(jsonStr string) (map[string]interface{}, error)

func JsonLoadsList

func JsonLoadsList(jsonStr string) ([]interface{}, error)

func StrToByte

func StrToByte(s string) (b []byte)

StrToByte 高效转换,避免内存拷贝

func ToFloat32

func ToFloat32(v interface{}) (float32, error)

func ToFloat64

func ToFloat64(v interface{}) (float64, error)

func ToInt64

func ToInt64(v interface{}) (int64, error)

func ToStr

func ToStr(v interface{}) string

Types

type InterfaceType

type InterfaceType int
const (
	UnImplementInterface InterfaceType = 0
	ListInterface        InterfaceType = 1
	MapInterface         InterfaceType = 2
)

func GetInterfaceType

func GetInterfaceType(i interface{}) InterfaceType

type ValType

type ValType int
const (
	UnKnownType ValType = 0

	Str     ValType = 1
	Int     ValType = 2
	Int64   ValType = 3
	Int32   ValType = 4
	Uint    ValType = 5
	Uint64  ValType = 6
	Uint32  ValType = 7
	Float32 ValType = 8
	Float64 ValType = 9
	Bool    ValType = 10

	Map   ValType = 21
	Array ValType = 32
	Slice ValType = 23

	Struct ValType = 41
	Ptr    ValType = 42
	Func   ValType = 43

	MapStrItf     ValType = 61
	MapIntItf     ValType = 62
	MapInt32Itf   ValType = 63
	MapInt64Itf   ValType = 64
	MapUintItf    ValType = 65
	MapUint32Itf  ValType = 66
	MapUint64Itf  ValType = 67
	MapFloatItf   ValType = 68
	MapFloat64Itf ValType = 69
	MapStructItf  ValType = 70
	MapFuncItf    ValType = 71

	ListItf     ValType = 81
	ListStr     ValType = 82
	ListInt     ValType = 83
	ListInt64   ValType = 84
	ListInt32   ValType = 85
	ListUint    ValType = 86
	ListUint32  ValType = 87
	ListUint64  ValType = 88
	ListFloat   ValType = 89
	ListFloat64 ValType = 90
	ListBool    ValType = 91
)

Jump to

Keyboard shortcuts

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