Documentation
¶
Overview ¶
CRC: crc-PathSyntax.md Spec: protocol.md
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path struct {
Segments []Segment
URLParams url.Values // ?create=Type&prop=value parameters
HasStandard bool // starts with @name
StandardName string // the @name without @
Raw string // original path string
}
Path represents a parsed variable path.
func Parse ¶
Parse splits a path string into segments and parameters. Examples:
- "name" -> property access
- "father.name" -> property.property
- "@customers.2.name" -> standard.index.property
- "getName()" -> method call
- ".." -> parent traversal
- "path?create=Type" -> path with URL params
func (*Path) GetStandardVariable ¶
GetStandardVariable returns the @name (without @) if present.
func (*Path) GetURLParams ¶
GetURLParams returns the parsed URL parameters.
func (*Path) HasURLParams ¶
HasURLParams returns true if the path has URL parameters.
type Segment ¶
type Segment struct {
Type SegmentType
Value string // property name, method name, or @name
Index int // for SegmentIndex (1-based)
}
Segment represents a single path segment.
func (*Segment) GetArrayIndex ¶
GetArrayIndex returns the 1-based index if this is an index segment.
func (*Segment) GetMethodCall ¶
GetMethodCall returns the method name if this is a method call segment.
func (*Segment) GetPropertyAccess ¶
GetPropertyAccess returns the property name if this is a simple property segment.
func (*Segment) IsParentTraversal ¶
IsParentTraversal returns true if this is a parent traversal segment.
type SegmentType ¶
type SegmentType int
SegmentType identifies the type of path segment.
const ( SegmentProperty SegmentType = iota // Simple property: name SegmentIndex // Array index: 1, 2 (1-based) SegmentParent // Parent traversal: .. SegmentMethod // Method call: getName() SegmentStandard // Standard variable: @name )