Documentation ¶
Overview ¶
Package codec provides encoding/decoding utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSON ¶
type JSON struct {
MaxSnippetSize int
}
JSON is a factory for JSON encoders and decoders.
func (*JSON) NewDecoder ¶
NewDecoder returns a new encoding/json style decoder agumenting it with snippets of the payload in case of errors.
func (*JSON) NewEncoder ¶
NewEncoder does not do anything different from the default encoder. Unfortunately, the default encoder does not do any writes at all until the full encoding has succeeded, so we cannot buffer the write and add it to the error like is done for the json.Decoder.
Click to show internal directories.
Click to hide internal directories.