Documentation ¶
Overview ¶
Package httprule contains utilities to describe HTTP route rules and is used by the configs and the code generators to prepare HTTP routes.
This is a package mostly useful for gateway mux developers and other internal tools. Unless you are building a gRPC gateway serve mux or tooling related to the gateway, do not use these packages. These packages are indirectly used when you use the code generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Segment ¶
type Segment struct { // Value holds string value and is contextualized based on segment type. Value string // Type describes the type of HTTP rule segment. Type SegmentType }
Segment is an HTTP rule path segment.
type SegmentType ¶
type SegmentType uint8
SegmentType is the type of path segment in the HTTP rule.
const ( SegmentTypeLiteral SegmentType = iota // SegmentTypeLiteral is a literal string. SegmentTypeSelector // SegmentTypeSelector is a variable. SegmentTypeCatchAllSelector // SegmentTypeCatchAllSelector is similar to selector but reads everything. )
type Template ¶
type Template struct { // Segments contains all of the path segments. Segments []Segment }
Template is an HTTP rule template that can be used to build out routes.
func (Template) HasVariables ¶
HasVariables returns whether or not the current template contains any binding variables.