Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
type Codec interface { // Marshal returns the special codec format of v. Marshal(v interface{}) ([]byte, error) // Unmarshal parses the special codec format into v. Unmarshal(data []byte, v interface{}) error // Name return the codec's name. Name() CodecType }
Codec defines the interface that nginet uses to encode and decode messages. a Codec's methods can be called from concurrent goroutines.
func GetCodec ¶
GetCodec return registered codec by name. Note: if codec with name 'name' not registered, a nil codec will returned.
func MustGetCodec ¶
MustGetCodec the same with GetCodec. but it will panic when the codec of name 'name' not registred.
Click to show internal directories.
Click to hide internal directories.