router

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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

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