-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9cfc51
commit e05aa99
Showing
11 changed files
with
215 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package route | ||
|
||
// routes stores a list of routes usually for a single host. | ||
type routes []*route | ||
type Routes []*Route | ||
|
||
// find returns the route with the given path and returns nil if none was found. | ||
func (rt routes) find(path string) *route { | ||
func (rt Routes) find(path string) *Route { | ||
for _, r := range rt { | ||
if r.path == path { | ||
if r.Path == path { | ||
return r | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
// sort by path in reverse order (most to least specific) | ||
func (rt routes) Len() int { return len(rt) } | ||
func (rt routes) Swap(i, j int) { rt[i], rt[j] = rt[j], rt[i] } | ||
func (rt routes) Less(i, j int) bool { return rt[j].path < rt[i].path } | ||
func (rt Routes) Len() int { return len(rt) } | ||
func (rt Routes) Swap(i, j int) { rt[i], rt[j] = rt[j], rt[i] } | ||
func (rt Routes) Less(i, j int) bool { return rt[j].Path < rt[i].Path } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.