aboutsummaryrefslogtreecommitdiff
path: root/echo/interfaces.go
blob: 1f3957a4b238e9013480d8e15487eeb59f8100fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package echo

import (
	"io/fs"

	"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
}

// WantsTemplateStore is an interface for template helper functions that
// need access to the template store for the running echo instance.
type WantsTemplateStore interface {
	ConfigureTemplateStore(fs.FS)
}