From cedc4f0eecb00f87d3e85bb4fba9e967f53485c1 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Fri, 19 Nov 2021 12:28:19 -0800 Subject: echo: add router interface --- echo/interfaces.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 echo/interfaces.go 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 @@ +package echo + +import ( + "github.com/labstack/echo/v4" +) + +// URLRouter is an interface that identifies the core traits of a URL router. +// This mainly exists to work around the fact that our server is actually a +// golib.EchoWrapper and not an echo.Echo. +type URLRouter interface { + DELETE(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + GET(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + HEAD(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + OPTIONS(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + PATCH(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + POST(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + PUT(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route + Group(string, ...echo.MiddlewareFunc) *echo.Group + Add(string, string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route +} -- cgit v1.2.3