httprouterx

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoCache

func NoCache(w http.ResponseWriter)

NoCache adds `Cache-Control: private, no-cache, no-store, must-revalidate` to the response header.

func NoCacheHandle

func NoCacheHandle(handle httprouter.Handle) httprouter.Handle

NoCacheHandle wraps httprouter.Handle with `Cache-Control: private, no-cache, no-store, must-revalidate` headers.

func NoCacheHandler

func NoCacheHandler(handle http.Handler) http.Handler

NoCacheHandler wraps http.HandlerFunc with `Cache-Control: private, no-cache, no-store, must-revalidate` headers.

func NoCacheHandlerFunc

func NoCacheHandlerFunc(handle http.HandlerFunc) http.HandlerFunc

NoCacheHandlerFunc wraps http.HandlerFunc with `Cache-Control: private, no-cache, no-store, must-revalidate` headers.

Types

type RouterAdmin

type RouterAdmin struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

RouterAdmin is a router able to prefix routes

func NewRouterAdmin

func NewRouterAdmin() *RouterAdmin

NewRouterAdmin creates a new admin router.

func NewRouterAdminWithPrefix

func NewRouterAdminWithPrefix(prefix string, baseURLProvider baseURLProvider) *RouterAdmin

NewRouterAdminWithPrefix creates a new router with is prefixed.

NewRouterAdminWithPrefix("/admin", func(context.Context) *url.URL { return &url.URL{/*...*/} })

func NewRouterAdminWithPrefixAndRouter

func NewRouterAdminWithPrefixAndRouter(root *httprouter.Router, prefix string, baseURLProvider baseURLProvider) *RouterAdmin

NewRouterAdminWithPrefixAndRouter wraps NewRouterAdminWithPrefix and additionally sets the base router.

func (*RouterAdmin) DELETE

func (r *RouterAdmin) DELETE(route string, handle httprouter.Handle)

func (*RouterAdmin) GET

func (r *RouterAdmin) GET(route string, handle httprouter.Handle)

func (*RouterAdmin) HEAD

func (r *RouterAdmin) HEAD(route string, handle httprouter.Handle)

func (*RouterAdmin) Handle

func (r *RouterAdmin) Handle(method, route string, handle httprouter.Handle)

func (*RouterAdmin) Handler

func (r *RouterAdmin) Handler(method, route string, handler http.Handler)

func (*RouterAdmin) HandlerFunc

func (r *RouterAdmin) HandlerFunc(method, route string, handler http.HandlerFunc)

func (*RouterAdmin) Lookup

func (r *RouterAdmin) Lookup(method, route string)

func (*RouterAdmin) PATCH

func (r *RouterAdmin) PATCH(route string, handle httprouter.Handle)

func (*RouterAdmin) POST

func (r *RouterAdmin) POST(route string, handle httprouter.Handle)

func (*RouterAdmin) PUT

func (r *RouterAdmin) PUT(route string, handle httprouter.Handle)

type RouterPublic

type RouterPublic struct {
	*httprouter.Router
}

RouterPublic wraps httprouter.Router

func NewRouterPublic

func NewRouterPublic() *RouterPublic

NewRouterPublic returns a public router.

func (*RouterPublic) DELETE

func (r *RouterPublic) DELETE(path string, handle httprouter.Handle)

func (*RouterPublic) GET

func (r *RouterPublic) GET(path string, handle httprouter.Handle)

func (*RouterPublic) HEAD

func (r *RouterPublic) HEAD(path string, handle httprouter.Handle)

func (*RouterPublic) Handle

func (r *RouterPublic) Handle(method, path string, handle httprouter.Handle)

func (*RouterPublic) Handler

func (r *RouterPublic) Handler(method, path string, handler http.Handler)

func (*RouterPublic) HandlerFunc

func (r *RouterPublic) HandlerFunc(method, path string, handler http.HandlerFunc)

func (*RouterPublic) PATCH

func (r *RouterPublic) PATCH(path string, handle httprouter.Handle)

func (*RouterPublic) POST

func (r *RouterPublic) POST(path string, handle httprouter.Handle)

func (*RouterPublic) PUT

func (r *RouterPublic) PUT(path string, handle httprouter.Handle)

Jump to

Keyboard shortcuts

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