http

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cacheable

func Cacheable(hdr http.Header) (time.Duration, bool, error)

func CopyRequest

func CopyRequest(r *http.Request) *http.Request

CopyRequest returns a clone of the provided *http.Request. The returned object is a shallow copy of the struct and a deep copy of its Header field.

func MergeQuery

func MergeQuery(u url.URL, q url.Values) url.URL

MergeQuery appends additional query values to an existing URL.

func NewResourceLocation

func NewResourceLocation(reqURL *url.URL, id string) string

NewResourceLocation appends a resource id to the end of the requested URL path.

func WriteError

func WriteError(w http.ResponseWriter, code int, msg string)

Types

type Client

type Client interface {
	Do(*http.Request) (*http.Response, error)
}

type HandlerClient

type HandlerClient struct {
	Handler http.Handler
}

func (*HandlerClient) Do

func (hc *HandlerClient) Do(r *http.Request) (*http.Response, error)

type RequestRecorder

type RequestRecorder struct {
	Response *http.Response
	Error    error

	Request *http.Request
}

func (*RequestRecorder) Do

func (rr *RequestRecorder) Do(req *http.Request) (*http.Response, error)

func (*RequestRecorder) RoundTrip

func (rr *RequestRecorder) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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