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.