Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
Codec embeds both Decoder and Encoder.
var Binary Codec = codecBinary{}
Binary codec encodes and decodes binary requests and responses. Decode/Unmarshal accepts an io.Writer and copies content to the writer. Encode/Marshal accepts an io.Reader and copies content from the reader.
var FormURLEncoded Codec = codecFormURLEncoded{}
FormURLEncoded (de)serializes Form parameters.
var JSON Codec = codecJSON{}
JSON codec encodes and decodes JSON requests and responses using github.com/palantir/pkg/safejson. On Decode, it sets UseNumber on the json.Decoder to account for large numbers. On Encode, we disable HTML escaping, which for bad reasons (as acknowledged by go team), is default-enabled.
var Plain Codec = codecPlain{}
Plain implements a text/plain codec. Values used to marshal/unmarshal must be of type string or encoding.TextMarshaler/encoding.TextUnmarshaler.
var Protobuf Codec = codecProtobuf{}
Protobuf codec encodes and decodes protobuf requests and responses using google.golang.org/protobuf.
func GZIP ¶ added in v2.58.0
GZIP wraps an existing Codec and uses gzip for compression and decompression.
func Snappy ¶ added in v2.47.0
Snappy wraps an existing Codec and uses snappy with no-framing for compression and decompression using github.com/golang/snappy. Ref: https://github.com/google/snappy/blob/main/format_description.txt