Documentation
¶
Overview ¶
Package encoding provides Decoding implementations.
Decode decodes HTTP responses:
resp, _ := http.Get("http://api.example.com/") ... var data map[string]interface{} err := JSONDecoder(resp.Body, &data)
Index ¶
Constants ¶
View Source
const JSON = "json"
JSON is the key for the json encoding
Variables ¶
This section is empty.
Functions ¶
func JSONCollectionDecoder ¶
JSONCollectionDecoder implements the Decoder interface over a collection
func JSONDecoder ¶
JSONDecoder implements the Decoder interface
func Register ¶
func Register(name string, dec DecoderFactory) error
Register registers the decoder factory with the given name
Types ¶
type Decoder ¶
A Decoder is a function that reads from the reader and decodes it into an map of interfaces
func NewJSONDecoder ¶
NewJSONDecoder return the right JSON decoder
type DecoderFactory ¶
A DecoderFactory is a function that returns CollectionDecoder or an EntityDecoder
func Get ¶
func Get(name string) DecoderFactory
Get returns (from the register) the decoder factory by name. If there is no factory with the received name it returns the JSON decoder factory
Click to show internal directories.
Click to hide internal directories.