router

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Echo             *echo.Echo
	Routes           func(e *echo.Echo, r *Router) error
	SkipMetrics      bool
	SkipHealthChecks bool
	HealthChecksDB   *gorm.DB
	SwaggerTitle     string
	SwaggerPath      string
}

Config contains the configuration for the router.

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route contains the details of a route.

type Router

type Router struct {
	Routes []Route
}

Router contains all the available routes of the service.

func AddRoute

func AddRoute(r *Router, group *echo.Group, path string, handlerFunc echo.HandlerFunc, restVerb string) *Router

AddRoute adds a route.

func NewRouter

func NewRouter(cfg Config) (*Router, error)

NewRouter creates a new Router.

func (*Router) PrintRoutes added in v0.1.0

func (r *Router) PrintRoutes(e *echo.Echo)

PrintRoutes prints all the available routes registered in the Echo framework.

func (*Router) Setup added in v0.1.0

func (r *Router) Setup() error

Setup configures the routes for echo.

type Validator

type Validator struct {
	Vdt *validator.Validate
}

Validator is the struct that contains the validator.

func NewValidator

func NewValidator() (*Validator, error)

NewValidator creates a new Validator.

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Validate validates a struct using the validator.

Jump to

Keyboard shortcuts

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