godock: github.com/sqp/godock/libs/net/download Index | Files

package download

import "github.com/sqp/godock/libs/net/download"

Package download gets content from internet.

Index

Package Files

download.go

Variables

var Default = Header{}

Default defines default settings for the package.

func Get Uses

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

Get gets data from url.

func JSON Uses

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

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

func Reader Uses

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

Reader gets a reader for the url.

func XML Uses

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

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

type Header map[string]string

Header represents a HTTP downloader with custom header settings.

func (Header) Get Uses

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

Get gets data from url.

func (Header) JSON Uses

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

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

func (Header) Reader Uses

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

Reader gets a reader for the url.

func (Header) XML Uses

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

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

Package download imports 5 packages (graph) and is imported by 4 packages. Updated 2017-09-14. Refresh now. Tools for package owners.