httpxrouter

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 4 Imported by: 0

README

Build Status

httpxrouter

-- import "github.com/smartystreets/httpxrouter"

Usage

func New
func New(options ...Option) http.Handler
type Option
type Option func(*routesBuilder)
func DELETE
func DELETE(path string, handlers ...nestingHandler) Option
func GET
func GET(path string, handlers ...nestingHandler) Option
func HEAD
func HEAD(path string, handlers ...nestingHandler) Option
func MethodNotAllowed
func MethodNotAllowed(handler http.Handler) Option
func NotFound
func NotFound(handler http.Handler) Option
func OPTIONS
func OPTIONS(path string, handlers ...nestingHandler) Option
func POST
func POST(path string, handlers ...nestingHandler) Option
func PUT
func PUT(path string, handlers ...nestingHandler) Option
func Panic
func Panic(callback func(http.ResponseWriter, *http.Request, interface{})) Option
func Prepend
func Prepend(handlers ...nestingHandler) Option
func Register
func Register(methods, paths string, handlers ...nestingHandler) Option

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) http.Handler

Types

type NestingHandler

type NestingHandler interface {
	http.Handler
	Install(inner http.Handler)
}

type Option

type Option func(*routesBuilder)

func Compound

func Compound(options ...Option) Option

func DELETE

func DELETE(path string, handlers ...NestingHandler) Option

func GET

func GET(path string, handlers ...NestingHandler) Option
func HEAD(path string, handlers ...NestingHandler) Option

func MethodNotAllowed

func MethodNotAllowed(handler http.Handler) Option

func NotFound

func NotFound(handler http.Handler) Option

func OPTIONS

func OPTIONS(path string, handlers ...NestingHandler) Option

func POST

func POST(path string, handlers ...NestingHandler) Option

func PUT

func PUT(path string, handlers ...NestingHandler) Option

func Panic

func Panic(callback func(http.ResponseWriter, *http.Request, interface{})) Option

func Prepend

func Prepend(handlers ...NestingHandler) Option

func Register

func Register(methods, paths string, handlers ...NestingHandler) Option

Jump to

Keyboard shortcuts

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