defaults

package
v2.0.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = echo.New()

Functions

func AddAcceptFormat

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

func AddFormatRenderer

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

func Binder() echo.Binder

Binder returns the binder instance.

func Clear

func Clear(middleware ...interface{})

Clear middleware

func Commit

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

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 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{}) interface{}

MetaHandler Add meta information about endpoint

func NamedRoutes

func NamedRoutes() map[string][]int

NamedRoutes returns the registered handler name.

func NewContext

func NewContext(req engine.Request, resp engine.Response) 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

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 PreUse

func PreUse(middleware ...interface{})

PreUse adds handler to the middleware chain.

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

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

func Renderer

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

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 SetFormatRenderers

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

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 Stop

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