download

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 5 Imported by: 0

Documentation

Overview

Package download gets content from internet.

Index

Constants

This section is empty.

Variables

View Source
var Default = Header{}

Default defines default settings for the package.

Functions

func Get

func Get(uri string) ([]byte, error)

Get gets data from url.

func JSON

func JSON(uri string, data interface{}) error

JSON gets data from url and unmarshal as JSON to data.

func Reader

func Reader(uri string) (io.ReadCloser, error)

Reader gets a reader for the url.

func XML

func XML(uri string, data interface{}) error

XML gets data from url and unmarshal as XML to data.

Types

type Header map[string]string

Header represents a HTTP downloader with custom header settings.

func (Header) Get

func (h Header) Get(uri string) ([]byte, error)

Get gets data from url.

func (Header) JSON

func (h Header) JSON(uri string, data interface{}) error

JSON gets data from url and unmarshal as JSON to data.

func (Header) Reader

func (h Header) Reader(uri string) (io.ReadCloser, error)

Reader gets a reader for the url.

func (Header) XML

func (h Header) XML(uri string, data interface{}) error

XML gets data from url and unmarshal as XML to data.

Jump to

Keyboard shortcuts

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