httppath

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package httppath shares HTTP pattern grammar between runtime and generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidText

func ValidText(text string) bool

ValidText checks lossless UTF-8 and excludes control characters.

Types

type Description added in v0.36.0

type Description struct {
	ParameterPrefix            string    `json:"parameter_prefix"`
	ParameterSuffix            string    `json:"parameter_suffix"`
	TailSuffix                 string    `json:"tail_suffix"`
	ParameterName              string    `json:"parameter_name"`
	ForbiddenLiteralCharacters string    `json:"forbidden_literal_characters"`
	ForbiddenSegments          [2]string `json:"forbidden_segments"`
	ControlMax                 int       `json:"control_max"`
	ControlDelete              int       `json:"control_delete"`
	TrailingSlash              string    `json:"trailing_slash"`
	UTF8Required               bool      `json:"utf8_required"`
	// Upload ingress bounds bytes; ValidText owns UTF-8 validation in the router.
	UploadIngressUTF8Enforced bool `json:"upload_ingress_utf8_enforced"`
}

Description is the machine-readable grammar exported with the deploy tools.

func Syntax added in v0.36.0

func Syntax() Description

Syntax describes the parser's single-segment subset for deployment tooling. Deploy policies add resource bounds and exclude catch-all parameters.

type Segment

type Segment struct {
	Literal string
	Name    string
	Tail    bool
}

Segment is a literal or named parameter in the shared route grammar.

func Parse

func Parse(pattern string) ([]Segment, error)

Parse validates route syntax without binding a concrete DTO or starting I/O.

Directories

Path Synopsis
cmd
export command
Command export publishes the router syntax for the standalone deploy bundle.
Command export publishes the router syntax for the standalone deploy bundle.

Jump to

Keyboard shortcuts

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