router

package
v0.0.0-...-7a19e20 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context, r Router) context.Context

Context with the given router.

func MustHandle

func MustHandle(ctx context.Context, pattern string, handler http.Handler)

MustHandle panics if context has no router.

func MustHandleFunc

func MustHandleFunc(ctx context.Context, pattern string, handler func(http.ResponseWriter, *http.Request))

MustHandleFunc panics if context has no router.

Types

type Router

type Router interface {
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}

Router for registering HTTP request handlers. Works like net/http.ServeMux.

func Contextual

func Contextual(ctx context.Context) Router

Contextual router or nil.

Jump to

Keyboard shortcuts

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