http

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodGet     = http.MethodGet
	MethodHead    = http.MethodHead
	MethodPost    = http.MethodPost
	MethodPut     = http.MethodPut
	MethodPatch   = http.MethodPatch
	MethodDelete  = http.MethodDelete
	MethodConnect = http.MethodConnect
	MethodOptions = http.MethodOptions
	MethodTrace   = http.MethodTrace
)

Variables

This section is empty.

Functions

func Handle

func Handle(h http.HandlerFunc, middleware ...Middleware) http.HandlerFunc

func Listen

func Listen(host string, port int, router http.Handler) error

func ListenWithTLS

func ListenWithTLS(host string, port int, caFile, certFile, keyFile string, router http.Handler) error

Types

type MethodNotAllowedHandler

type MethodNotAllowedHandler struct {
	http.Handler
}

func (MethodNotAllowedHandler) ServeHTTP

type Middleware

type Middleware func(http.HandlerFunc) http.HandlerFunc

type NotFoundHandler

type NotFoundHandler struct {
	http.Handler
}

func (NotFoundHandler) ServeHTTP

func (NotFoundHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Route

type Route struct {
	Path       string
	Handler    func(w http.ResponseWriter, r *http.Request)
	Middleware []Middleware
	Method     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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