msgpack

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 1 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal returns the MessagePack-encoded byte array of v.

func MarshalAsArray

func MarshalAsArray(v interface{}) ([]byte, error)

MarshalAsArray encodes data as array format. This is the same thing that StructAsArray sets true.

func MarshalAsMap

func MarshalAsMap(v interface{}) ([]byte, error)

MarshalAsMap encodes data as map format. This is the same thing that StructAsArray sets false.

func SetComplexTypeCode

func SetComplexTypeCode(code int8)

SetComplexTypeCode sets def.complexTypeCode in github.com/shamaton/msgpack

func SetResolver

func SetResolver(encAsMap, encAsArray EncResolver, decAsMap, decAsArray DecResolver)

SetResolver sets generated resolvers to bridge variables.

func SetStructAsArray

func SetStructAsArray(on bool)

SetStructAsArray sets default encoding option. If this option sets true, default encoding sets to array-format.

func StructAsArray

func StructAsArray() bool

StructAsArray gets default encoding option. If this option sets true, default encoding sets to array-format.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal analyzes the MessagePack-encoded data and stores the result into the pointer of v.

func UnmarshalAsArray

func UnmarshalAsArray(data []byte, v interface{}) error

UnmarshalAsArray decodes data that is encoded as array format. This is the same thing that StructAsArray sets true.

func UnmarshalAsMap

func UnmarshalAsMap(data []byte, v interface{}) error

UnmarshalAsMap decodes data that is encoded as map format. This is the same thing that StructAsArray sets false.

Types

type DecResolver

type DecResolver func(data []byte, i interface{}) (bool, error)

DecResolver is a definition to resolve de-serialization.

type EncResolver

type EncResolver func(i interface{}) ([]byte, error)

EncResolver is a definition to resolve serialization.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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