providers

package
v0.0.0-...-9336e07 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fnc ProviderFunc)

Types

type ErrHTTPStatus

type ErrHTTPStatus struct {
	Code   int
	Status string
}

func (*ErrHTTPStatus) Error

func (e *ErrHTTPStatus) Error() string

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(base string) HTTPClient

func (*HTTPClient) DoHTML

func (c *HTTPClient) DoHTML(ctx context.Context, req *http.Request) (*goquery.Document, error)

func (*HTTPClient) DoRaw

func (c *HTTPClient) DoRaw(ctx context.Context, req *http.Request) (*http.Response, error)

func (*HTTPClient) Get

func (c *HTTPClient) Get(ctx context.Context, path string, params url.Values) (*http.Response, error)

func (*HTTPClient) GetHTML

func (c *HTTPClient) GetHTML(ctx context.Context, path string, params url.Values) (*goquery.Document, error)

func (*HTTPClient) GetJSON

func (c *HTTPClient) GetJSON(ctx context.Context, path string, params url.Values, dst interface{}) error

func (*HTTPClient) GetRequest

func (c *HTTPClient) GetRequest(path string, params url.Values) (*http.Request, error)

func (*HTTPClient) GetXML

func (c *HTTPClient) GetXML(ctx context.Context, path string, params url.Values, dst interface{}) error

func (*HTTPClient) PostHTML

func (c *HTTPClient) PostHTML(ctx context.Context, path string, params url.Values) (*goquery.Document, error)

func (*HTTPClient) SetHTTPClient

func (c *HTTPClient) SetHTTPClient(cli *http.Client)

type Provider

type Provider = base.Provider

type ProviderFunc

type ProviderFunc func(ctx context.Context) (Provider, error)

func List

func List() []ProviderFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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