Versions in this module Expand all Collapse all v1 v1.0.0 Sep 15, 2022 v0 v0.1.1 Dec 26, 2019 v0.1.0 Dec 26, 2019 v0.0.1 Dec 1, 2019 v0.0.0 Dec 1, 2019 Changes in this version + const DELETE + const GET + const HEAD + const LINK + const OPTIONS + const PATCH + const POST + const PUT + const StatusAccepted + const StatusAlreadyReported + const StatusBadGateway + const StatusBadRequest + const StatusConflict + const StatusContinue + const StatusCreated + const StatusExpectationFailed + const StatusFailedDependency + const StatusForbidden + const StatusFound + const StatusGatewayTimeout + const StatusGone + const StatusHTTPVersionNotSupported + const StatusIMUsed + const StatusInsufficientStorage + const StatusInternalServerError + const StatusLengthRequired + const StatusLocked + const StatusLoopDetected + const StatusMethodNotAllowed + const StatusMovedPermanently + const StatusMultiStatus + const StatusMultipleChoices + const StatusNetworkAuthenticationRequired + const StatusNoContent + const StatusNonAuthoritativeInfo + const StatusNotAcceptable + const StatusNotExtended + const StatusNotFound + const StatusNotImplemented + const StatusNotModified + const StatusOK + const StatusPartialContent + const StatusPaymentRequired + const StatusPermanentRedirect + const StatusPreconditionFailed + const StatusPreconditionRequired + const StatusProcessing + const StatusProxyAuthRequired + const StatusRequestEntityTooLarge + const StatusRequestHeaderFieldsTooLarge + const StatusRequestTimeout + const StatusRequestURITooLong + const StatusRequestedRangeNotSatisfiable + const StatusResetContent + const StatusSeeOther + const StatusServiceUnavailable + const StatusSwitchingProtocols + const StatusTeapot + const StatusTemporaryRedirect + const StatusTooManyRequests + const StatusUnauthorized + const StatusUnavailableForLegalReasons + const StatusUnprocessableEntity + const StatusUnsupportedMediaType + const StatusUpgradeRequired + const StatusUseProxy + const StatusVariantAlsoNegotiates + const TRACE + const TimeFormat + const UNLINK + var DefaultClient = &Client + func Get(ctx context.Context, url string) (*http.Response, error) + func Head(ctx context.Context, url string) (resp *http.Response, err error) + func Post(ctx context.Context, url string, contentType string, body io.Reader) (resp *http.Response, err error) + func PostForm(ctx context.Context, url string, data url.Values) (resp *http.Response, err error) + type Client struct + HTTP http.Client + PropagateContext bool + func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error) + func (c *Client) Get(ctx context.Context, url string) (*http.Response, error) + func (c *Client) Head(ctx context.Context, url string) (*http.Response, error) + func (c *Client) Post(ctx context.Context, url string, bodyType string, body io.Reader) (*http.Response, error) + func (c *Client) PostForm(ctx context.Context, url string, data url.Values) (*http.Response, error) + type Endpoint interface + Attach func(*mux.Router, func(http.ResponseWriter, *http.Request)) + Method func() string + Path func() string + Serve func(ctx context.Context, w ResponseWriter, r *Request) + type Middleware func(ServeFunc) ServeFunc + type Option func(*Server) + func OptIdleTimeout(d time.Duration) Option + func OptReadHeaderTimeout(d time.Duration) Option + func OptReadTimeout(d time.Duration) Option + func OptTLS(config *tls.Config) Option + func OptWriteTimeout(d time.Duration) Option + type ParseGob struct + func (d *ParseGob) Parse(v interface{}) error + func (d *ParseGob) Type() string + type ParseJSON struct + func (d *ParseJSON) Parse(v interface{}) error + func (d *ParseJSON) Type() string + type ParseNull struct + func (d *ParseNull) Parse(v interface{}) error + func (d *ParseNull) Type() string + type Parser interface + Parse func(v interface{}) error + Type func() string + type RenderConditional struct + ETag string + LastModified time.Time + Next Renderer + Req *http.Request + func (r *RenderConditional) Render(res ResponseWriter) error + type RenderContent struct + Content io.ReadSeeker + Modtime time.Time + Req *http.Request + func (r *RenderContent) Render(res ResponseWriter) error + type RenderData struct + Code int + ContentType string + Reader io.ReadCloser + func (r *RenderData) Render(res ResponseWriter) error + type RenderGob struct + Code int + V interface{} + func (r *RenderGob) Render(res ResponseWriter) error + type RenderHead struct + Code int + func (r *RenderHead) Render(res ResponseWriter) error + type RenderJSON struct + Code int + V interface{} + func (r *RenderJSON) Render(res ResponseWriter) error + type RenderRedirect struct + Req *http.Request + URL string + func (r *RenderRedirect) Render(res ResponseWriter) error + type Renderer interface + Render func(ResponseWriter) error + type Request struct + HTTP *http.Request + Params map[string]string + func (r *Request) Parse(ctx context.Context, v interface{}) error + type ResponseWriter interface + Code func() int + Conditional func(req *http.Request, etag string, lastModified time.Time, next func() error) error + Content func(req *http.Request, content io.ReadSeeker, modtime ...time.Time) error + Data func(code int, contentType string, data io.ReadCloser) error + Gob func(code int, data interface{}) error + HasCode func() bool + Head func(code int) error + Header func() http.Header + JSON func(code int, data interface{}) error + Redirect func(req *http.Request, url string) error + Write func([]byte) (int, error) + WriteHeader func(int) + type ServeFunc func(ctx context.Context, w ResponseWriter, r *Request) + type Server struct + func NewServer() *Server + func (s *Server) ActivateTLS(certFile, keyFile string) + func (s *Server) Append(m Middleware) + func (s *Server) Drain() + func (s *Server) HandleEndpoint(e Endpoint) + func (s *Server) HandleFunc(path, method string, f func(ctx context.Context, w ResponseWriter, r *Request)) + func (s *Server) HandleStatic(path, root string, ...) + func (s *Server) Serve(ctx context.Context, addr string) error + func (s *Server) SetOptions(opts ...Option)