Documentation ¶
Overview ¶
Package protobuf provides fasthttp codec for protobuf.
Index ¶
- Variables
- func DecodeProtobufRequest(_ context.Context, r *fasthttp.Request, request interface{}) error
- func DecodeProtobufResponse(_ context.Context, resp *fasthttp.Response, response interface{}) error
- func EncodeProtobufRequest(_ context.Context, r *fasthttp.Request, request interface{}) error
- func EncodeProtobufResponse(_ context.Context, resp *fasthttp.Response, response interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // IngoreContentType Content-Type header will be ignored when decoding the body IngoreContentType bool // ProtobufContentType Content-Type header value that indicates that the content is protocol buffer ProtobufContentType = "application/x-protobuf" // DefaultBufferSize Buffer default size DefaultBufferSize = 64 )
Functions ¶
func DecodeProtobufRequest ¶
DecodeProtobufRequest is an fasthttp_transport.DecodeRequestFunc that deserializes the response as a protobuf message object from the Request body. Many protobuf-over-HTTP services can use it as a sensible default.
func DecodeProtobufResponse ¶
DecodeProtobufResponse is an fasthttp_transport.DecodeResponseFunc that deserializes the response as a response object from the Response body. Many protobuf-over-HTTP services can use it as a sensible default.
func EncodeProtobufRequest ¶
EncodeProtobufRequest is an fasthttp_transport.EncodeRequestFunc that serializes the request as a protobuf message object to the Request body. Many protobuf-over-HTTP services can use it as a sensible default. If the request implements Headerer, the provided headers will be applied to the request.
func EncodeProtobufResponse ¶
EncodeProtobufResponse is a fasthttp_transport.EncodeResponseFunc that serializes the response as a protobuf message object to the Response. Many protobuf-over-HTTP services can use it as a sensible default. If the response implements Headerer, the provided headers will be applied to the response. If the response implements StatusCoder, the provided StatusCode will be used instead of 200.
Types ¶
This section is empty.