Documentation ¶
Overview ¶
Package proto defines the protobuf codec. Importing this package will register the codec.
Index ¶
- Constants
- func NewPBTwoWayCodec() encoding.TwoWayCodec
- type PBTwoWayCodec
- func (h *PBTwoWayCodec) MarshalRequest(v interface{}) ([]byte, error)
- func (h *PBTwoWayCodec) MarshalResponse(v interface{}) ([]byte, error)
- func (h *PBTwoWayCodec) Name() string
- func (h *PBTwoWayCodec) UnmarshalRequest(data []byte, v interface{}) error
- func (h *PBTwoWayCodec) UnmarshalResponse(data []byte, v interface{}) error
Constants ¶
View Source
const Name = "proto"
Name is the name registered for the proto compressor.
Variables ¶
This section is empty.
Functions ¶
func NewPBTwoWayCodec ¶ added in v1.42.6
func NewPBTwoWayCodec() encoding.TwoWayCodec
NewPBTwoWayCodec new PBTwoWayCodec instance
Types ¶
type PBTwoWayCodec ¶ added in v1.42.6
type PBTwoWayCodec struct {
// contains filtered or unexported fields
}
PBTwoWayCodec is pb impl of TwoWayCodec
func (*PBTwoWayCodec) MarshalRequest ¶ added in v1.42.6
func (h *PBTwoWayCodec) MarshalRequest(v interface{}) ([]byte, error)
MarshalRequest marshal interface @v to []byte
func (*PBTwoWayCodec) MarshalResponse ¶ added in v1.42.6
func (h *PBTwoWayCodec) MarshalResponse(v interface{}) ([]byte, error)
MarshalResponse marshal interface @v to []byte
func (*PBTwoWayCodec) Name ¶ added in v1.42.6
func (h *PBTwoWayCodec) Name() string
func (*PBTwoWayCodec) UnmarshalRequest ¶ added in v1.42.6
func (h *PBTwoWayCodec) UnmarshalRequest(data []byte, v interface{}) error
UnmarshalRequest unmarshal bytes @data to interface
func (*PBTwoWayCodec) UnmarshalResponse ¶ added in v1.42.6
func (h *PBTwoWayCodec) UnmarshalResponse(data []byte, v interface{}) error
UnmarshalResponse unmarshal bytes @data to interface
Click to show internal directories.
Click to hide internal directories.