iendecode

package
v0.0.0-...-2e4edee Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToBytes

func BoolToBytes(bo bool) (b []byte)

func BytesGobReflect

func BytesGobReflect(f_b []byte, v reflect.Value) error

将[]byte转成提供的反射Value

func BytesGobStruct

func BytesGobStruct(f_b []byte, stur interface{}) error

将[]byte转成Gob再转成结构体

func BytesToBool

func BytesToBool(b []byte) (bo bool)

func BytesToInt

func BytesToInt(b []byte) (i int)

func BytesToInt16

func BytesToInt16(b []byte) (i int16)

func BytesToInt32

func BytesToInt32(b []byte) (i int32)

func BytesToInt64

func BytesToInt64(b []byte) (i int64)

func BytesToInt8

func BytesToInt8(b []byte) (i int8)

func BytesToMap

func BytesToMap(thetype string, b []byte) (themaps interface{}, err error)

Support map[string]string, map[string]time.Time, map[string]int64, map[string]uint64, map[string]float64, map[string]complex128.

func BytesToSingle

func BytesToSingle(thetype string, b []byte) (data interface{}, err error)

Support bool, byte, all int, all uint, all float, all complex, which implements the encoding.BinaryMarshaler interface, which support gob encode.

func BytesToSlice

func BytesToSlice(thetype string, b []byte) (slice interface{}, err error)

Support bool, int, uint, int8, uint8, int64, uint64, float64, complex128, string, time.Time slice.

func BytesToSliceString

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

func BytesToUint

func BytesToUint(b []byte) (i uint)

func BytesToUint16

func BytesToUint16(buf []byte) uint16

[]byte转uint16

func BytesToUint32

func BytesToUint32(buf []byte) uint32

[]byte转uint32

func BytesToUint64

func BytesToUint64(buf []byte) uint64

[]byte转uint64

func BytesToUint8

func BytesToUint8(buf []byte) uint8

[]byte转uint8

func FromBinary

func FromBinary(b []byte, e interface{}) (err error)

func Int16ToBytes

func Int16ToBytes(i int16) (b []byte)

func Int32ToBytes

func Int32ToBytes(i int32) (b []byte)

func Int64ToBytes

func Int64ToBytes(i int64) (b []byte)

func Int8ToBytes

func Int8ToBytes(i int8) (b []byte)

func IntToBytes

func IntToBytes(i int) (b []byte)

func JsonToStruct

func JsonToStruct(f_b string, stur interface{}) (err error)

将json的字符串转成结构体

func MapToBytes

func MapToBytes(thetype string, themaps interface{}) (b []byte, err error)

Support map[string]string, map[string]time.Time, map[string]int64, map[string]uint64, map[string]float64, map[string]complex128.

func SingleToBytes

func SingleToBytes(thetype string, data interface{}) (b []byte, err error)

Support bool, byte, all int, all uint, all float, all complex, string, []byte, time.Time.

func SliceStringToBytes

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

func SliceToBytes

func SliceToBytes(thetype string, slice interface{}) (b []byte, err error)

Support bool, int, uint, int8, uint8, int64, uint64, float64, complex128, string, time.Time slice.

func StructGobBytes

func StructGobBytes(e interface{}) ([]byte, error)

将结构体数据转成Gob再转成[]Byte

func StructToJson

func StructToJson(e interface{}) (str string, err error)

将结构体转成Json的字符串

func ToBinary

func ToBinary(e interface{}) (b []byte, err error)

func Uint16ToBytes

func Uint16ToBytes(i uint16) []byte

Uint16转[]byte

func Uint32ToBytes

func Uint32ToBytes(i uint32) []byte

Uint32转[]byte

func Uint64ToBytes

func Uint64ToBytes(i uint64) []byte

Uint64转[]byte

func Uint8ToBytes

func Uint8ToBytes(i uint8) []byte

Uint8转[]byte

func UintToBytes

func UintToBytes(i uint) (b []byte)

Types

type BinaryCoder

type BinaryCoder interface {
	MarshalBinary() (data []byte, err error)
	UnmarshalBinary(data []byte) error
}

Jump to

Keyboard shortcuts

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