echokit

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderTotalCount header total count
	HeaderTotalCount = "X-Total-Count"
)

Variables

This section is empty.

Functions

func DumpEcho added in v0.9.8

func DumpEcho(e *echo.Echo) []string

DumpEcho dump route in echo server

func HTTPError added in v0.9.8

func HTTPError(err error) *echo.HTTPError

HTTPError convert error to *echo.HTTPError

func NewValidErr added in v0.9.8

func NewValidErr(message string) *echo.HTTPError

NewValidErr create ValidationError

func SetRoute added in v0.8.32

func SetRoute(server Server, routers ...Router)

SetRoute to server

Types

type Router added in v0.8.32

type Router interface {
	SetRoute(Server)
}

Router responsible to route

func NewRouter added in v0.9.8

func NewRouter(fn SetRouteFn) Router

NewRouter return new instance of Router

type Server added in v0.8.32

type Server interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	Any(path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) []*echo.Route
	Add(method, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	Match(methods []string, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route
	Group(prefix string, m ...echo.MiddlewareFunc) *echo.Group
	Use(m ...echo.MiddlewareFunc)
}

Server interface for echo.Echo and echo.Group

type SetRouteFn added in v0.9.8

type SetRouteFn func(Server)

SetRouteFn function SetRoute

Jump to

Keyboard shortcuts

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