conv

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(i interface{}) bool

Bool converts <i> to Bool.

func Byte

func Byte(i interface{}) byte

Byte Convert <i> to byte.

func Bytes

func Bytes(i interface{}) []byte

Bytes Convert <i> to []byte.

func BytesToStruct

func BytesToStruct(data []byte, to interface{}) error

BytesToStruct Using gob encoding is generally used for "similar" two structure transmission binding or RPC communication

func Float32

func Float32(i interface{}) float32

Float32 converts <i> to float32.

func Float32ToBytes

func Float32ToBytes(float float32) []byte

Float32ToBytes converts <i> to []byte.

func Float64

func Float64(i interface{}) float64

Float64 converts <i> to float64.

func Float64ToBytes

func Float64ToBytes(float float64) []byte

Float64ToBytes converts <i> to []byte.

func Indirect added in v1.1.6

func Indirect(v reflect.Value) reflect.Value

Indirect returns last value that v points to

func Int

func Int(i interface{}) int

Int converts <i> to int.

func Int16

func Int16(i interface{}) int16

Int16 converts <i> to int16.

func Int32

func Int32(i interface{}) int32

Int32 converts <i> to int32.

func Int32s

func Int32s(i interface{}) []int32

Int32s Convert <i> to []int32.

func Int64

func Int64(i interface{}) int64

Int64 converts <i> to int64.

func Int64s

func Int64s(i interface{}) []int64

Int64s Convert <i> to []int64.

func Int8

func Int8(i interface{}) int8

Int8 converts <i> to int8.

func InterfaceToStruct added in v1.1.6

func InterfaceToStruct(data interface{}) interface{}

InterfaceToStruct interface conversion Struct

func Ints

func Ints(i interface{}) []int

Ints Convert <i> to []int.

func Map

func Map(i interface{}) map[string]interface{}

Map converts <i> to map[string]interface{}.

func MapInt

func MapInt(i interface{}) map[int]interface{}

MapInt converts <i> to map[int]interface{}.

func MapString

func MapString(i interface{}) map[string]string

MapString converts <i> to map[string]string.

func Rune

func Rune(i interface{}) rune

Rune Convert <i> to Rune.

func Runes

func Runes(i interface{}) []rune

Runes Convert <i> to []rune.

func String

func String(i interface{}) string

String Convert <i> to String.

func Strings

func Strings(i interface{}) []string

Strings Convert <i> to []string.

func Struct

func Struct(model interface{}, data interface{})

Struct conversion binding model Bound model data Data

func StructToBytes

func StructToBytes(data interface{}) []byte

StructToBytes Use gob encoding generally used for "similar" two structure transmission binding or RPC communication

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 Uint32s

func Uint32s(i interface{}) []uint32

Uint32s Convert <i> to []uint32.

func Uint64

func Uint64(i interface{}) uint64

Uint64 converts <i> to uint64.

func Uint64s

func Uint64s(i interface{}) []uint64

Uint64s Convert <i> to []uint64.

func Uint8

func Uint8(i interface{}) uint8

Uint8 converts <i> to uint8.

func Uints

func Uints(i interface{}) []uint

Uints Convert <i> to []uint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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