router

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 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

This section is empty.

Types

type Router

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

Router routes incoming HTTP requests to the adequate handler based on their URL path.

func (*Router) DeregisterPath

func (r *Router) DeregisterPath(urlPath string)

DeregisterPath de-registers the HTTP handler for the given URL path.

func (*Router) HandlersCount added in v1.15.0

func (r *Router) HandlersCount(filters ...handlerMatcherFunc) int

HandlersCount returns the number of handlers that are currently registered.

func (*Router) RegisterPath

func (r *Router) RegisterPath(urlPath string, h http.Handler)

RegisterPath registers a HTTP handler for serving requests at the given URL path.

func (*Router) ServeHTTP

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

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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