route

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package route will hold the routes and route groups

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router *Router) error

RegisterRoutes with the echo routers - Router is defined within openapi.go

Types

type Router

type Router struct {
	Echo    *echo.Echo
	OAS     *openapi3.T
	Handler *handlers.Handler
}

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

func (r *Router) AddEchoOnlyRoute(pattern, method string, route echo.Routable) error

AddEchoOnlyRoute is used to add a route to the echo router without adding it to the OpenAPI schema

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) AddUnversionedRoute

func (r *Router) AddUnversionedRoute(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) Addv1Route

func (r *Router) Addv1Route(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) Base

func (r *Router) Base() *echo.Group

Base returns the base echo group - no "version" prefix for the router group

func (*Router) VersionOne

func (r *Router) VersionOne() *echo.Group

VersionOne returns a new echo group for version 1 of the API

func (*Router) VersionTwo

func (r *Router) VersionTwo() *echo.Group

VersionTwo returns a new echo group for version 2 of the API - lets anticipate the future

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL