defaults

package
v2.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 103

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = echo.New()

Functions

func AddAcceptFormat added in v1.3.0

func AddAcceptFormat(mime, format string) *echo.Echo

func AddFormatRenderer added in v1.3.7

func AddFormatRenderer(format string, renderer func(c echo.Context, data interface{}) error) *echo.Echo

func AddHandlerWrapper

func AddHandlerWrapper(funcs ...func(interface{}) echo.Handler)

func AddMiddlewareWrapper

func AddMiddlewareWrapper(funcs ...func(interface{}) echo.Middleware)

func Any

func Any(path string, h interface{}, m ...interface{}) echo.IRouter

Any adds a route > handler to the router for all HTTP methods.

func Binder added in v1.3.0

func Binder() echo.Binder

Binder returns the binder instance.

func Clear added in v1.3.0

func Clear(middleware ...interface{})

Clear middleware

func Commit added in v1.6.0

func Commit() *echo.Echo

func Connect

func Connect(path string, h interface{}, m ...interface{}) echo.IRouter

Connect adds a CONNECT route > handler to the router.

func Debug

func Debug() bool

Debug returns debug mode (enabled or disabled).

func DefaultHTTPErrorHandler

func DefaultHTTPErrorHandler(err error, c echo.Context)

DefaultHTTPErrorHandler invokes the default HTTP error handler.

func Delete

func Delete(path string, h interface{}, m ...interface{}) echo.IRouter

Delete adds a DELETE route > handler to the router.

func Engine

func Engine() engine.Engine

func Get

func Get(path string, h interface{}, m ...interface{}) echo.IRouter

Get adds a GET route > handler to the router.

func Group

func Group(prefix string, m ...interface{}) *echo.Group

Group creates a new sub-router with prefix.

func HTTPErrorHandler added in v1.3.0

func HTTPErrorHandler() echo.HTTPErrorHandler

HTTPErrorHandler returns the HTTPErrorHandler

func Head(path string, h interface{}, m ...interface{}) echo.IRouter

Head adds a HEAD route > handler to the router.

func Host added in v1.6.0

func Host(name string, m ...interface{}) *echo.Group

func Logger

func Logger() logger.Logger

Logger returns the logger instance.

func Match

func Match(methods []string, path string, h interface{}, m ...interface{}) echo.IRouter

Match adds a route > handler to the router for multiple HTTP methods provided.

func MetaHandler

func MetaHandler(m echo.H, handler interface{}, requests ...echo.RequestValidator) interface{}

MetaHandler Add meta information about endpoint

func MustGetContext added in v1.6.0

func MustGetContext(ctx context.Context, args ...*echo.Echo) echo.Context

func NamedRoutes

func NamedRoutes() map[string][]int

NamedRoutes returns the registered handler name.

func NewContext added in v1.5.0

func NewContext(req engine.Request, resp engine.Response) echo.Context

func NewMockContext added in v1.6.0

func NewMockContext(args ...*echo.Echo) echo.Context

func Options

func Options(path string, h interface{}, m ...interface{}) echo.IRouter

Options adds an OPTIONS route > handler to the router.

func ParseHeaderAccept added in v1.3.9

func ParseHeaderAccept(on bool) *echo.Echo

func Patch

func Patch(path string, h interface{}, m ...interface{}) echo.IRouter

Patch adds a PATCH route > handler to the router.

func Post

func Post(path string, h interface{}, m ...interface{}) echo.IRouter

Post adds a POST route > handler to the router.

func Pre

func Pre(middleware ...interface{})

Pre is alias

func Prefix

func Prefix() string

func Put

func Put(path string, h interface{}, m ...interface{}) echo.IRouter

Put adds a PUT route > handler to the router.

func RebuildRouter

func RebuildRouter(args ...[]*echo.Route) *echo.Echo

RebuildRouter rebuild router

func RemoveFormatRenderer added in v1.3.7

func RemoveFormatRenderer(formats ...string) *echo.Echo

func Renderer added in v1.3.0

func Renderer() echo.Renderer

Renderer returns the renderer instance.

func Route

func Route(methods string, path string, h interface{}, m ...interface{}) echo.IRouter

func Router

func Router() *echo.Router

Router returns router.

func Routes

func Routes() []*echo.Route

Routes returns the registered routes.

func Run

func Run(eng engine.Engine, handler ...engine.Handler) error

Run starts the HTTP engine.

func ServeHTTP

func ServeHTTP(req engine.Request, res engine.Response)

func SetAcceptFormats added in v1.3.0

func SetAcceptFormats(acceptFormats map[string]string) *echo.Echo

func SetBinder

func SetBinder(b echo.Binder)

SetBinder registers a custom binder. It's invoked by Context.Bind().

func SetDebug

func SetDebug(on bool)

SetDebug enable/disable debug mode.

func SetFormSliceMaxIndex added in v1.6.0

func SetFormSliceMaxIndex(max int) *echo.Echo

func SetFormatRenderers added in v1.3.7

func SetFormatRenderers(formatRenderers map[string]func(c echo.Context, data interface{}) error) *echo.Echo

func SetHTTPErrorHandler

func SetHTTPErrorHandler(h echo.HTTPErrorHandler)

SetHTTPErrorHandler registers a custom Echo.HTTPErrorHandler.

func SetHandlerWrapper

func SetHandlerWrapper(funcs ...func(interface{}) echo.Handler)

func SetLogger

func SetLogger(l logger.Logger)

SetLogger sets the logger instance.

func SetMiddlewareWrapper

func SetMiddlewareWrapper(funcs ...func(interface{}) echo.Middleware)

func SetPrefix added in v1.4.3

func SetPrefix(prefix string) *echo.Echo

func SetRenderer

func SetRenderer(r echo.Renderer)

SetRenderer registers an HTML template renderer. It's invoked by Context.Render().

func SetValidator added in v1.6.0

func SetValidator(validator echo.Validator) *echo.Echo

func Shutdown added in v1.6.0

func Shutdown(ctx context.Context) error

func Stop added in v1.2.0

func Stop() error

Stop stops the HTTP server.

func Trace

func Trace(path string, h interface{}, m ...interface{}) echo.IRouter

Trace adds a TRACE route > handler to the router.

func TypeHost added in v1.6.0

func TypeHost(alias string, args ...interface{}) echo.TypeHost

func URI

func URI(handler interface{}, params ...interface{}) string

URI generates a URI from handler.

func URL

func URL(h interface{}, params ...interface{}) string

URL is an alias for `URI` function.

func Use

func Use(middleware ...interface{})

Use adds handler to the middleware chain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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