-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Router.Mutable to update the route handler
- Loading branch information
Sergio Andres Virviescas Santana
committed
Jun 9, 2020
1 parent
298eced
commit f41abad
Showing
8 changed files
with
196 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package radix | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
const ( | ||
errSetHandler = "a handler is already registered for path '%s'" | ||
errSetWildcardHandler = "a wildcard handler is already registered for path '%s'" | ||
errWildPathConflict = "'%s' in new path '%s' conflicts with existing wild path '%s' in existing prefix '%s'" | ||
errWildcardConflict = "'%s' in new path '%s' conflicts with existing wildcard '%s' in existing prefix '%s'" | ||
errWildcardSlash = "no / before wildcard in path '%s'" | ||
errWildcardNotAtEnd = "wildcard routes are only allowed at the end of the path in path '%s'" | ||
) | ||
|
||
type radixError struct { | ||
msg string | ||
params []interface{} | ||
} | ||
|
||
func (err *radixError) Error() string { | ||
return fmt.Sprintf(err.msg, err.params...) | ||
} | ||
|
||
func newRadixError(msg string, params ...interface{}) *radixError { | ||
return &radixError{msg, params} | ||
} |
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
Oops, something went wrong.