pathvar

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMatchedRoutePath added in v1.13.0

func GetMatchedRoutePath(r *http.Request) string

GetMatchedRoutePath returns the matched route path pattern from the request context. For example, if the registered route is "/api/users/:id" and the request is "GET /api/users/123", this returns "/api/users/:id".

func GetMeta added in v1.13.3

func GetMeta(r *http.Request) map[string]string

GetMeta returns the route meta from the request context.

func GetMetaFromContext added in v1.13.3

func GetMetaFromContext(ctx context.Context) map[string]string

GetMetaFromContext returns the route meta from the context.

func GetRouteFromContext added in v1.13.1

func GetRouteFromContext(ctx context.Context) string

GetRouteFromContext returns the matched route path pattern from the context.

func Vars

func Vars(r *http.Request) map[string]string

Vars parses path variables and returns a map.

func WithMatchedRoutePath added in v1.13.0

func WithMatchedRoutePath(r *http.Request, path string) *http.Request

WithMatchedRoutePath writes the matched route path pattern into the request context.

func WithMeta added in v1.13.3

func WithMeta(r *http.Request, meta map[string]string) *http.Request

WithMeta writes the route meta into the request context.

func WithVars

func WithVars(r *http.Request, params map[string]string) *http.Request

WithVars writes params into given r and returns a new http.Request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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