encoding

package
v0.0.0-...-6582c30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2017 License: Apache-2.0 Imports: 4 Imported by: 2

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

View Source
const RSS = "rss"

RSS is the key for the rss encoding

View Source
const XML = "xml"

XML is the key for the xml encoding

Variables

This section is empty.

Functions

func JSONCollectionDecoder

func JSONCollectionDecoder(r io.Reader, v *map[string]interface{}) error

JSONCollectionDecoder implements the Decoder interface over a collection

func JSONDecoder

func JSONDecoder(r io.Reader, v *map[string]interface{}) error

JSONDecoder implements the Decoder interface

func XMLCollectionDecoder

func XMLCollectionDecoder(r io.Reader, v *map[string]interface{}) error

XMLCollectionDecoder implements the Decoder interface over a collection

func XMLDecoder

func XMLDecoder(r io.Reader, v *map[string]interface{}) error

XMLDecoder implements the Decoder interface

Types

type Decoder

type Decoder func(r io.Reader, v *map[string]interface{}) error

A Decoder is a function that reads from the reader and decodes it into an map of interfaces

func NewJSONDecoder

func NewJSONDecoder(isCollection bool) Decoder

NewJSONDecoder return the right JSON decoder

func NewRSSDecoder

func NewRSSDecoder() Decoder

NewRSSDecoder returns the RSS decoder

func NewXMLDecoder

func NewXMLDecoder(isCollection bool) Decoder

NewXMLDecoder return the right XML decoder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL