golug_codec

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Name = "codec"

Functions

func GetCfg

func GetCfg() (cfg map[string]Cfg)

func List

func List() (dt map[string]Codec)

func Register

func Register(name string, codec Codec)

Types

type Cfg

type Cfg struct {
}

func GetDefaultCfg

func GetDefaultCfg() Cfg

type Codec

type Codec interface {
	Name() string
	Encode(i interface{}) ([]byte, error)
	Decode(data []byte, i interface{}) error
}

Codec defines the interface that decode/encode payload.

func Get

func Get(name string) Codec

Jump to

Keyboard shortcuts

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