defaults

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 103

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = echo.New()

Functions

func AcquireMockContext added in v1.8.2

func AcquireMockContext() echo.Context

func AddAcceptFormat added in v1.3.0

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

func AddBinderValueDecoder added in v1.6.0

func AddBinderValueDecoder(name string, decoder echo.BinderValueDecoder) *echo.Echo

func AddBinderValueEncoder added in v1.6.0

func AddBinderValueEncoder(name string, encoder echo.BinderValueEncoder) *echo.Echo

func AddFormatRenderer added in v1.3.7

func AddFormatRenderer(format string, renderer echo.FormatRender) *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 DefaultExtension added in v1.6.0

func DefaultExtension() string

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 IsMockContext added in v1.7.9

func IsMockContext(c echo.Context) bool

func Logger

func Logger() logger.Logger

Logger returns the logger instance.

func MakeHandler added in v1.8.0

func MakeHandler(handler interface{}, requests ...interface{}) echo.Handler

MakeHandler make validateable hanlder

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 MaxRequestBodySize added in v1.6.0

func MaxRequestBodySize() int

func MetaHandler

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

MetaHandler Add meta information about endpoint

func MetaHandlerWithRequest added in v1.6.0

func MetaHandlerWithRequest(m echo.H, handler interface{}, request interface{}, methods ...string) echo.Handler

MetaHandlerWithRequest 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 OnHostFound added in v1.6.0

func OnHostFound(onHostFound func(echo.Context) (bool, error)) *echo.Echo

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 RealIPConfig added in v1.6.0

func RealIPConfig() *realip.Config

func RebuildRouter

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

RebuildRouter rebuild router

func RegisterPoolMockContextIniter added in v1.8.2

func RegisterPoolMockContextIniter(init func(echo.Context))

func ReleaseMockContext added in v1.8.2

func ReleaseMockContext(ctx echo.Context)

func RemoveFormatRenderer added in v1.3.7

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

func RenderDataWrapper added in v1.6.0

func RenderDataWrapper() echo.DataWrapper

RenderDataWrapper .

func Renderer added in v1.3.0

func Renderer() echo.Renderer

Renderer returns the renderer instance.

func ResetPoolMockContextIniter added in v1.8.2

func ResetPoolMockContextIniter(init func(echo.Context))

func Rewriter added in v1.6.0

func Rewriter() echo.Rewriter

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 SetDefaultExtension added in v1.6.0

func SetDefaultExtension(ext string)

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]echo.FormatRender) *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 SetMaxRequestBodySize added in v1.6.0

func SetMaxRequestBodySize(maxRequestSize int) *echo.Echo

func SetMiddlewareWrapper

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

func SetPrefix added in v1.4.3

func SetPrefix(prefix string) *echo.Echo

func SetRenderDataWrapper added in v1.6.0

func SetRenderDataWrapper(dataWrapper echo.DataWrapper)

SetRenderDataWrapper .

func SetRenderer

func SetRenderer(r echo.Renderer)

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

func SetRewriter added in v1.6.0

func SetRewriter(r echo.Rewriter)

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