Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualLocation ¶
EqualLocation reports whether a and b encode the same path and query.
Types ¶
type Adapter ¶
type Adapter[M any] interface { AnyAdapter Decode(any) (*M, bool) Encode(model *M) (Location, error) Assert(any) (*M, bool) }
func NewAdapter ¶
func NewLocationAdapter ¶
NewLocationAdapter returns an adapter that treats Location as a path model.
type Adapters ¶
type Adapters []AnyAdapter
func (*Adapters) Add ¶
func (as *Adapters) Add(a AnyAdapter)
type Location ¶
type Location struct {
// Query holds the decoded query parameters.
Query url.Values
// Segments holds the decoded path segments without leading or trailing
// slashes.
Segments []string
}
Location is a parsed or generated URL path plus query string.
func NewLocationFromEscapedURI ¶
NewLocationFromEscapedURI parses s into a Location.
func NewLocationFromURL ¶
NewLocationFromURL decodes u into a Location.
Click to show internal directories.
Click to hide internal directories.