Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanPath ¶
CleanPath is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.
The following rules are applied iteratively until no further processing can be done:
- Replace multiple slashes with a single slash.
- Eliminate each . path name element (the current directory).
- Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
- Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.
If the result of this process is an empty string, "/" is returned
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) AddRoute ¶
AddRoute adds a node with the given handle to the path. Not concurrency-safe!
func (*Node) FindCaseInsensitivePath ¶
func (n *Node) FindCaseInsensitivePath(path string, fixTrailingSlash bool) (ciPath []byte, found bool)
Makes a case-insensitive lookup of the given path and tries to find a handler. It can optionally also fix trailing slashes. It returns the case-corrected path and a bool indicating whether the lookup was successful.
Click to show internal directories.
Click to hide internal directories.