Documentation
¶
Overview ¶
Package route will hold the routes and route groups
Index ¶
- Variables
- func RegisterRoutes(router *Router) error
- type Config
- type Router
- func (r *Router) AddEchoOnlyRoute(route echo.Routable) error
- func (r *Router) AddGraphQLToOpenAPI()
- func (r *Router) AddRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error
- func (r *Router) AddUnversionedHandlerRoute(config Config) error
- func (r *Router) AddUnversionedRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error
- func (r *Router) AddV1HandlerRoute(config Config) error
- func (r *Router) AddV1Route(pattern, method string, op *openapi3.Operation, route echo.Routable) error
- func (r *Router) Base() *echo.Group
- func (r *Router) VersionOne() *echo.Group
- func (r *Router) VersionTwo() *echo.Group
- type RouterOption
- func WithEcho(e *echo.Echo) RouterOption
- func WithHandler(h *handlers.Handler) RouterOption
- func WithHideBanner() RouterOption
- func WithLocalFiles(lf string) RouterOption
- func WithLogger(logger *echo.Logger) RouterOption
- func WithOpenAPI(oas *openapi3.T) RouterOption
- func WithOptions(opts ...RouterOption) RouterOption
- type SchemaRegistry
Constants ¶
This section is empty.
Variables ¶
var ErrAuthenticationRequired = errors.New("authentication required")
Functions ¶
func RegisterRoutes ¶
RegisterRoutes with the echo routers - Router is defined within openapi.go
Types ¶
type Config ¶ added in v0.25.0
type Config struct {
Path string
Method string
Name string
Description string
Tags []string
OperationID string
Security *openapi3.SecurityRequirements
Middlewares []echo.MiddlewareFunc
Handler func(echo.Context, *handlers.OpenAPIContext) error
SimpleHandler func(echo.Context) error // For handlers that don't need OpenAPI context
}
Config holds the configuration for a route with automatic OpenAPI registration
type Router ¶
type Router struct {
Echo *echo.Echo
OAS *openapi3.T
Handler *handlers.Handler
StartConfig *echo.StartConfig
LocalFilePath string
Logger *echo.Logger
SchemaRegistry SchemaRegistry
}
Router is a struct that holds the echo router, the OpenAPI schema, and the handler - it's a way to group these components together
func (*Router) AddEchoOnlyRoute ¶
AddEchoOnlyRoute is used to add a route to the echo router without adding it to the OpenAPI schema
func (*Router) AddGraphQLToOpenAPI ¶ added in v0.30.12
func (r *Router) AddGraphQLToOpenAPI()
AddGraphQLToOpenAPI adds the GraphQL endpoint to the OpenAPI specification
func (*Router) AddRoute ¶
func (r *Router) AddRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error
AddRoute is used to add a route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server
func (*Router) AddUnversionedHandlerRoute ¶ added in v0.25.0
AddUnversionedHandlerRoute adds an unversioned route with automatic OpenAPI context injection
func (*Router) AddUnversionedRoute ¶
func (r *Router) AddUnversionedRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error
AddUnversionedRoute is used to add a versioned route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server
func (*Router) AddV1HandlerRoute ¶ added in v0.25.0
AddV1HandlerRoute adds a route with automatic OpenAPI context injection
func (*Router) AddV1Route ¶ added in v0.12.2
func (r *Router) AddV1Route(pattern, method string, op *openapi3.Operation, route echo.Routable) error
AddV1Route is used to add a route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server for version 1 routes of the api
func (*Router) VersionOne ¶
VersionOne returns a new echo group for version 1 of the API
func (*Router) VersionTwo ¶
VersionTwo returns a new echo group for version 2 of the API - lets anticipate the future
type RouterOption ¶ added in v0.3.0
type RouterOption func(*Router)
RouterOption is an option function that can be used to configure the router
func WithEcho ¶ added in v0.3.0
func WithEcho(e *echo.Echo) RouterOption
WithEcho is a RouterOption that allows the echo router to be set on the router
func WithHandler ¶ added in v0.3.0
func WithHandler(h *handlers.Handler) RouterOption
WithHandler is a RouterOption that allows the handler to be set on the router
func WithHideBanner ¶ added in v0.3.0
func WithHideBanner() RouterOption
WithHideBanner is a RouterOption that allows the banner to be hidden on the echo server
func WithLocalFiles ¶ added in v0.6.10
func WithLocalFiles(lf string) RouterOption
WithLocalFiles is a RouterOption that allows the local files to be set on the router
func WithLogger ¶ added in v0.8.6
func WithLogger(logger *echo.Logger) RouterOption
WithLogger is a RouterOption that allows the logger to be set on the router
func WithOpenAPI ¶ added in v0.3.0
func WithOpenAPI(oas *openapi3.T) RouterOption
WithOpenAPI is a RouterOption that allows the OpenAPI schema to be set on the router
func WithOptions ¶ added in v0.3.0
func WithOptions(opts ...RouterOption) RouterOption
WithOptions is a RouterOption that allows multiple options to be set on the router
Source Files
¶
- 2fa.go
- accountaccess.go
- accountfeatures.go
- accountroles.go
- accountrolesorganization.go
- acmesolver.go
- base.go
- csrf.go
- doc.go
- files.go
- forgotpass.go
- impersonation.go
- invite.go
- job_runner.go
- login.go
- oauth.go
- oauth_integration.go
- productcatalog.go
- refresh.go
- register.go
- resend.go
- resetpass.go
- router.go
- scim.go
- sso.go
- sso_token.go
- static.go
- subscribe.go
- switch.go
- trustcenter_anonymousjwt.go
- verify.go
- webauthn.go
- webhook.go
- wellknown.go