Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTypeAlreadyDefined is returned when an already defined message type is redefined. ErrTypeAlreadyDefined = errors.New("message type is already defined") // ErrUnknownType is returned when a definition for an unknown message type is is requested. ErrUnknownType = errors.New("message type unknown") )
Functions ¶
func RegisterType ¶
func RegisterType(msgType Type, def *Definition) error
RegisterType registers the given message type with its definition.
Types ¶
type Definition ¶
Definition describes a message's ID and its max byte length (and whether the length variable).
func DefinitionForType ¶
func DefinitionForType(msgType Type) (*Definition, error)
DefinitionForType returns the definition for the given message type.
func Definitions ¶
func Definitions() []*Definition
Definitions returns all registered message definitions.
Click to show internal directories.
Click to hide internal directories.