gofetcher

package
v0.0.0-...-c6ce543 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout         = 5000
	DefaultFollowRedirects = true
	KeepAliveTimeout       = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookies

type Cookies map[string]string

type Gofetcher

type Gofetcher struct {
	Logger    *cocaine.Logger
	Transport http.RoundTripper

	UserAgent string
}

func NewGofetcher

func NewGofetcher() *Gofetcher

func (*Gofetcher) ExecuteRequest

func (gofetcher *Gofetcher) ExecuteRequest(req *http.Request, client *http.Client, attempt int) (*http.Response, error)

func (*Gofetcher) GetHandler

func (gofetcher *Gofetcher) GetHandler(method string) func(request *cocaine.Request, response *cocaine.Response)

func (*Gofetcher) HttpEcho

func (gofetcher *Gofetcher) HttpEcho(res http.ResponseWriter, req *http.Request)

func (*Gofetcher) HttpProxy

func (gofetcher *Gofetcher) HttpProxy(res http.ResponseWriter, req *http.Request)

func (*Gofetcher) ParseRequest

func (gofetcher *Gofetcher) ParseRequest(method string, requestBody []byte) (request *Request)

func (*Gofetcher) PrepareRequest

func (gofetcher *Gofetcher) PrepareRequest(request *Request) (*http.Request, *http.Client, error)

func (*Gofetcher) SetUserAgent

func (gofetcher *Gofetcher) SetUserAgent(userAgent string)

func (*Gofetcher) WriteError

func (gofetcher *Gofetcher) WriteError(response *cocaine.Response, request *Request, err error)

func (*Gofetcher) WriteResponse

func (gofetcher *Gofetcher) WriteResponse(response *cocaine.Response, request *Request, resp *http.Response, body []byte)

type Request

type Request struct {
	Method          string
	URL             string
	Body            io.Reader
	Timeout         int64
	Cookies         Cookies
	Headers         http.Header
	FollowRedirects bool
}

type Response

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

type WarnError

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

func NewWarn

func NewWarn(err error) *WarnError

func (*WarnError) Error

func (s *WarnError) Error() string

Jump to

Keyboard shortcuts

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