path

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Package path provide path based routing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type H

type H map[string]http.HandlerFunc

H is type for mapping path and its handler

parameterized segment of path can be prefixed with ":", example:

/info/:userid/name

handler registered here is compared by prefix path match,

h := H{
	"a/b": myhandler,
}.C()

request to "/a/b/c/d/e" will be still handled by myhandler, see segment.MustEnd

func (H) C

func (h H) C() http.HandlerFunc

C same as Compile with def equal to nil

func (H) Compile

func (h H) Compile(notfoundHandler http.HandlerFunc) http.HandlerFunc

Compile into single http.HandlerFunc

Jump to

Keyboard shortcuts

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