Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCodec
deprecated
func RegisterCodec(codec Codec)
RegisterCodec registers the provided Codec for use with all Transport clients and servers.
Deprecated: use RegisterEncoder and RegisterDecoder
func RegisterDecoder ¶
RegisterDecoder registers the provided Decoder with specific content types for use with all Transport clients and servers.
func RegisterEncoder ¶
RegisterEncoder registers the provided Encoder with specific content types for use with all Transport clients and servers.
Types ¶
type Codec
deprecated
type Codec interface { Encoder Decoder // Name returns the name of the Codec implementation. The returned string // will be used as part of content type in transmission. The result must be // static; the result cannot change between calls. Name() string }
Codec defines the interface Transport uses to encode and decode messages. Note that implementations of this interface must be thread safe; a Codec's methods can be called from concurrent goroutines.
Deprecated: use Encoder and Decoder
type Decoder ¶
type Decoder interface { // Unmarshal parses the wire format into v. Unmarshal(data []byte, v interface{}) error }
Decoder defines the interface Transport uses to decode messages. Note that implementations of this interface must be thread safe; a Decoder's methods can be called from concurrent goroutines.
func GetDecoders ¶
GetDecoders gets registered Decoders by content-type, or none if no Decoder is registered for the content-type.
type Encoder ¶
type Encoder interface { // Marshal returns the wire format of v. Marshal(v interface{}) ([]byte, error) }
Encoder defines the interface Transport uses to encode messages. Note that implementations of this interface must be thread safe; a Encoder's methods can be called from concurrent goroutines.
func GetEncoders ¶
GetEncoders gets registered Encoders by content-type, or none if no Encoder is registered for the content-type.