server

package
v0.0.0-...-a26ee7b Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddController

func AddController(server *echo.Echo, controller EchoController)

func AddControllers

func AddControllers(server *echo.Echo, controllers []EchoController)

Types

type Controller

type Controller struct {
	Method  RequestMethod
	Path    string
	Handler func(c echo.Context) error
	Body    reflect.Type
}

func (Controller) GetBodyType

func (c Controller) GetBodyType() reflect.Type

func (Controller) GetHandler

func (c Controller) GetHandler() func(c echo.Context) error

func (Controller) GetMethod

func (c Controller) GetMethod() RequestMethod

func (Controller) GetPath

func (c Controller) GetPath() string

func (Controller) ValidateBody

func (c Controller) ValidateBody() bool

type CustomValidator

type CustomValidator struct {
	Validator *validator.Validate
}

func (*CustomValidator) Validate

func (validator *CustomValidator) Validate(i interface{}) error

type EchoController

type EchoController interface {
	GetMethod() RequestMethod
	GetPath() string
	GetHandler() func(c echo.Context) error
	ValidateBody() bool
	GetBodyType() reflect.Type
}

type RequestMethod

type RequestMethod int
const (
	GET RequestMethod = iota
	POST
	PUT
	DELETE
)

Jump to

Keyboard shortcuts

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