Documentation
¶
Overview ¶
Package resourcepaths parses API and other resource paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Path ¶
Path represents a parsed path.
func Parse ¶
func Parse(errs *perr.List, startPos token.Pos, path string, options Options) (parsedPath *Path, ok bool)
Parse parses a slash-separated path into path segments.
strPos is the position of where the path string was found in the source code.
func (*Path) NumParams ¶
NumParams reports the number of parameterized (non-literal) segments in the path.
type Segment ¶
type Segment struct { Type SegmentType Value string // literal if Type == Literal; name of parameter otherwise ValueType schema.BuiltinKind StartPos token.Pos EndPos token.Pos }
Segment represents a parsed path segment.
type SegmentType ¶
type SegmentType int
SegmentType represents the different types of path segments recognized by the parser.
const ( // Literal is a literal string path segment. Literal SegmentType = iota // Param represents a single path segment of any (non-empty) value. Param // Wildcard represents zero or more path segments of any value. Wildcard )
Click to show internal directories.
Click to hide internal directories.