|
Packit Service |
3a6627 |
|
|
Packit Service |
3a6627 |
|
|
Packit Service |
3a6627 |
// This is a simple interface which specifies echo.Route addition functions which
|
|
Packit Service |
3a6627 |
// are present on both echo.Echo and echo.Group, since we want to allow using
|
|
Packit Service |
3a6627 |
// either of them for path registration
|
|
Packit Service |
3a6627 |
type EchoRouter interface {
|
|
Packit Service |
3a6627 |
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
Packit Service |
3a6627 |
}
|
|
Packit Service |
3a6627 |
|
|
Packit Service |
3a6627 |
// RegisterHandlers adds each server route to the EchoRouter.
|
|
Packit Service |
3a6627 |
func RegisterHandlers(router EchoRouter, si ServerInterface) {
|
|
Packit Service |
3a6627 |
{{if .}}
|
|
Packit Service |
3a6627 |
wrapper := ServerInterfaceWrapper{
|
|
Packit Service |
3a6627 |
Handler: si,
|
|
Packit Service |
3a6627 |
}
|
|
Packit Service |
3a6627 |
{{end}}
|
|
Packit Service |
3a6627 |
{{range .}}router.{{.Method}}("{{.Path | swaggerUriToEchoUri}}", wrapper.{{.OperationId}})
|
|
Packit Service |
3a6627 |
{{end}}
|
|
Packit Service |
3a6627 |
}
|