Documentation ¶
Index ¶
Constants ¶
View Source
const ( MAX_SIZE_MB = 4 MAX_SIZE_BYTES = MAX_SIZE_MB * 1024 * 1024 DECODER_BUFFER_SIZE = 4 * 1024 )
Variables ¶
View Source
var ( // ErrSize is returned by Decode calls when a message would exceed the maximum allowed size. ErrSize = fmt.Errorf("proto: message exceeds %dMB", MAX_SIZE_MB) ProtobufCodec = &Codec{ Name: "protobuf", DecoderContentType: "application/x-protobuf", EncoderContentType: "application/x-protobuf", NewDecoder: func(r framing.Reader) *Decoder { return NewProtobufDecoder(r) }, NewEncoder: func(w io.Writer) *Encoder { return NewProtobufEncoder(w) }, } )
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct { Name string DecoderContentType string EncoderContentType string NewEncoder NewEncoderFunc NewDecoder NewDecoderFunc }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewJsonDecoder ¶
func NewProtobufDecoder ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewJsonEncoder ¶
func NewProtobufEncoder ¶
type NewDecoderFunc ¶
type NewEncoderFunc ¶
Click to show internal directories.
Click to hide internal directories.