Documentation ¶
Overview ¶
Package pathmap provides utilities for matching and generating paths based on a pattern string.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper provides path parsing and generating with named segments See NewMapper for details on construction
func NewMapper ¶
NewMapper produces a Mapper object from a pattern string. Patterns strings are paths that have named segments that are extracted during parsing and populated during generation. Example:
m := NewMapper("/dir/:segment/home/:rest*") s, err := m.Parse("/dir/foo/home/hello/world") // {"segment": "foo", "rest": "hello/world"}, nil p := m.Generate(s) // /dir/foo/home/hello/world
Click to show internal directories.
Click to hide internal directories.