dconv

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StructTagPriority = []string{"c", "p", "json"}

Functions

func Bool

func Bool(i interface{}) bool

Bool 把任何类型转换成bool类型

func Byte

func Byte(i interface{}) byte

Byte 把对象转换成一个byte

func Bytes

func Bytes(i interface{}) []byte

Bytes 把对象转化成byte数组

func Convert added in v0.0.3

func Convert(any interface{}, t string, params ...interface{}) interface{}

func Duration added in v0.0.3

func Duration(any interface{}) time.Duration

Duration 把参数转换成Duration格式

func Float32

func Float32(i interface{}) float32

Float32 转换成float32

func Float64

func Float64(i interface{}) float64

Float64 转换成float64

func Int

func Int(i interface{}) int

Int converts <i> to int.

func Int16

func Int16(i interface{}) int16

func Int32

func Int32(i interface{}) int32

Int32 converts <i> to int32.

func Int64

func Int64(i interface{}) int64

func Int8

func Int8(i interface{}) int8

Int8 converts <i> to int8.

func Interfaces

func Interfaces(i interface{}) []interface{}

func Map

func Map(value interface{}, tags ...string) map[string]interface{}

Map 把value值转换成map

func MapDeep

func MapDeep(value interface{}, tags ...string) map[string]interface{}

MapDeep 把value值转换成map,并且支持递归转换

func MapStrStr

func MapStrStr(value interface{}, tags ...string) map[string]string

MapStrStr 转换成key和value都是字符串的map

func MapStrStrDeep

func MapStrStrDeep(value interface{}, tags ...string) map[string]string

MapStrStrDeep 递归转换成key和value都是字符串的map

func Rune

func Rune(i interface{}) rune

Rune rune 类型,代表一个 UTF-8 字符,把其他类型转换成rune

func Runes

func Runes(i interface{}) []rune

Runes converts <i> to []rune.

func SliceAny

func SliceAny(i interface{}) []interface{}

SliceAny 把任何对象转换成切片

func SliceStr

func SliceStr(i interface{}) []string

func String

func String(i interface{}) string

String 把 i 转换成string类型

func Strings

func Strings(i interface{}) []string

func Struct added in v0.0.3

func Struct(params interface{}, pointer interface{}, mapping ...map[string]string) (err error)

func Uint

func Uint(i interface{}) uint

Uint converts <i> to uint.

func Uint16

func Uint16(i interface{}) uint16

Uint16 converts <i> to uint16.

func Uint32

func Uint32(i interface{}) uint32

Uint32 converts <i> to uint32.

func Uint64

func Uint64(i interface{}) uint64

func Uint8

func Uint8(i interface{}) uint8

Uint8 converts <i> to uint8.

func UnsafeBytesToStr

func UnsafeBytesToStr(b []byte) string

func UnsafeStrToBytes

func UnsafeStrToBytes(s string) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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