codec

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 1 Imported by: 0

README

##Codec: Encode/Decode

负责特殊数据类型[]byte到map的转换

####支持的类型为:

None = "none"
Javascript = "raw"
Protobuf = "protobuf"
IntoyunTLV = "intoyuntlv"

接口:

package codec

type Coder interface {
    Decode(data []byte) (map[string]interface{}, error)
    Encode(map[string]interface{}) ([]byte, error)
}

Documentation

Index

Constants

View Source
const (
	None       = "none"
	Javascript = "raw"
	Protobuf   = "protobuf"
	IntoyunTLV = "intoyuntlv"
)

Variables

This section is empty.

Functions

func GetBuilder

func GetBuilder(name string) (b func() Coder, err error)

func RegisterBuilder

func RegisterBuilder(name string, builder func() Coder)

Types

type Coder

type Coder interface {
	Decode(appId string, data []byte) (props map[string]interface{}, err error)
	Encode(appId string, props map[string]interface{}) (data []byte, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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