ggclient

package
v0.0.0-...-8e42b5d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAll

func ReadAll(resp *http.Response, err error) ([]byte, error)

Types

type Client

type Client struct {
	// hostname:port for the GGFetch service.
	Host string
	// Default TTL value for requests. It will be override explicitly in the Do method.
	TTL uint32
	// HTTP Client to use. Will use http.DefaultClient if nil.
	Client *http.Client
}

func (Client) Dimension

func (c Client) Dimension(u string) (w, h int, err error)

func (Client) Do

func (c Client) Do(method string, ttl uint32, kvs ...string) (*http.Response, error)

func (Client) HTML

func (c Client) HTML(u string) (string, io.ReadCloser, error)

func (Client) Image

func (c Client) Image(u string, width int) (content []byte, err error)

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

func JSON

func JSON(resp *http.Response, err error) Decoder

JSON can be used to decode a single value.

Jump to

Keyboard shortcuts

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