diff options
author | Mike Crute <mike@crute.us> | 2021-11-19 12:28:19 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2021-11-19 12:28:19 -0800 |
commit | cedc4f0eecb00f87d3e85bb4fba9e967f53485c1 (patch) | |
tree | 466e08912cee0bb3450b9276b02e7736cd4b01d0 | |
parent | e2b768f30784018274ece4a5abb0b9270e54a6e8 (diff) | |
download | golib-cedc4f0eecb00f87d3e85bb4fba9e967f53485c1.tar.bz2 golib-cedc4f0eecb00f87d3e85bb4fba9e967f53485c1.tar.xz golib-cedc4f0eecb00f87d3e85bb4fba9e967f53485c1.zip |
echo: add router interfaceecho/v0.5.1
-rw-r--r-- | echo/interfaces.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/echo/interfaces.go b/echo/interfaces.go new file mode 100644 index 0000000..f3380c6 --- /dev/null +++ b/echo/interfaces.go | |||
@@ -0,0 +1,20 @@ | |||
1 | package echo | ||
2 | |||
3 | import ( | ||
4 | "github.com/labstack/echo/v4" | ||
5 | ) | ||
6 | |||
7 | // URLRouter is an interface that identifies the core traits of a URL router. | ||
8 | // This mainly exists to work around the fact that our server is actually a | ||
9 | // golib.EchoWrapper and not an echo.Echo. | ||
10 | type URLRouter interface { | ||
11 | DELETE(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
12 | GET(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
13 | HEAD(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
14 | OPTIONS(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
15 | PATCH(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
16 | POST(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
17 | PUT(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
18 | Group(string, ...echo.MiddlewareFunc) *echo.Group | ||
19 | Add(string, string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route | ||
20 | } | ||