route

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 5 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

Overview

Package route owns immutable route metadata and pure method/path matching. HTTP request mechanics belong to gateway/http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

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

func NewBundle

func NewBundle(components []*spec.Component) (*Bundle, error)

func (*Bundle) AllowedMethodsForPath

func (b *Bundle) AllowedMethodsForPath(path string) []string

func (*Bundle) ComponentByKey

func (b *Bundle) ComponentByKey(key spec.Key) (*spec.Component, bool)

func (*Bundle) ComponentByRoute

func (b *Bundle) ComponentByRoute(method, path string) (*spec.Component, bool)

func (*Bundle) ComponentByRouteWithParams

func (b *Bundle) ComponentByRouteWithParams(method, path string) (*spec.Component, map[string]string, bool)

func (*Bundle) RouteByMethodPath

func (b *Bundle) RouteByMethodPath(method, path string) (*spec.Route, bool)

type Exposure

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

Exposure selects public package import paths independently of dependency loading. An empty include list exposes nothing. Exclusions take precedence.

func NewExposure

func NewExposure(include, exclude []string) (*Exposure, error)

func (*Exposure) Allows

func (p *Exposure) Allows(packagePath string) bool

type PathTemplate

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

PathTemplate is an immutable compiled route path.

func CompilePathTemplate

func CompilePathTemplate(path string) (*PathTemplate, error)

CompilePathTemplate compiles an authored absolute route path.

func (*PathTemplate) EscapedTemplatePath

func (t *PathTemplate) EscapedTemplatePath() string

EscapedTemplatePath returns an RFC6570-compatible escaped path while preserving authored placeholders.

func (*PathTemplate) MatchEscapedPath

func (t *PathTemplate) MatchEscapedPath(escapedPath string) (map[string]string, bool, error)

MatchEscapedPath matches an escaped path and decodes every segment exactly once.

func (*PathTemplate) Parameters

func (t *PathTemplate) Parameters() []string

Parameters returns placeholder names in authored order.

func (*PathTemplate) Path

func (t *PathTemplate) Path() string

Path returns the authored path.

Jump to

Keyboard shortcuts

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