router

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 3 Imported by: 2 modules, 2 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 RouteFromContext added in v1.9.1

func RouteFromContext(ctx context.Context) string

func RouteFromRequest added in v1.9.1

func RouteFromRequest(r *http.Request) string

Types

type Params

type Params = httprouter.Params

func ParamsFromContext

func ParamsFromContext(ctx context.Context) Params

func ParamsFromRequest

func ParamsFromRequest(http *http.Request) Params

type Router

type Router struct {
	// contains filtered or unexported fields
}

func New

func New() *Router

func (*Router) DELETE

func (r *Router) DELETE(path string, handler http.Handler) *Router

func (*Router) GET

func (r *Router) GET(path string, handler http.Handler) *Router

func (*Router) Handler

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

func (*Router) InternalRouter

func (r *Router) InternalRouter() *httprouter.Router

func (*Router) POST

func (r *Router) POST(path string, handler http.Handler) *Router

func (*Router) PUT

func (r *Router) PUT(path string, handler http.Handler) *Router

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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