package
Version:
v0.0.0-...-9c04300
Opens a new window with list of versions in this module.
Published: Apr 29, 2020
License: BSD-3-Clause
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Codec
-
type ID
-
type Message
-
type Meta
-
func Json(msg interface{}) (Meta, error)
-
func MetaByID(id ID) (Meta, bool)
-
func MetaByMsg(msg interface{}) (Meta, bool)
-
func MetaByName(name string) (Meta, bool)
-
func MetaByType(typo reflect.Type) (Meta, bool)
-
func Register(msg interface{}, codec Codec) (Meta, error)
-
func RegisterEx(id ID, name string, msg interface{}, codec Codec) (Meta, error)
type Codec interface {
Encode(msg interface{}) (raw []byte, err error)
Decode(raw []byte, msg interface{}) (err error)
}
type Message struct {
Meta Meta
Msg interface{}
Raw []byte
Stream []byte
}
type Meta interface {
ID() ID
Name() string
Codec() Codec
Encode(msg interface{}) (raw []byte, err error)
Decode(raw []byte) (msg interface{}, err error)
}
func MetaByMsg(msg interface{}) (Meta, bool)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.