{"modulePath":"github.com/labstack/echo","version":"v3.3.10+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package echo\n\nPackage echo implements high performance, minimalist Go web framework.\n\nExample:\n\n\tpackage main\n\n\timport (\n\t  \"net/http\"\n\n\t  \"github.com/labstack/echo\"\n\t  \"github.com/labstack/echo/middleware\"\n\t)\n\n\t// Handler\n\tfunc hello(c echo.Context) error {\n\t  return c.String(http.StatusOK, \"Hello, World!\")\n\t}\n\n\tfunc main() {\n\t  // Echo instance\n\t  e := echo.New()\n\n\t  // Middleware\n\t  e.Use(middleware.Logger())\n\t  e.Use(middleware.Recover())\n\n\t  // Routes\n\t  e.GET(\"/\", hello)\n\n\t  // Start server\n\t  e.Logger.Fatal(e.Start(\":1323\"))\n\t}\n\nLearn more at [https://echo.labstack.com](https://echo.labstack.com)\n\n## Constants\n\n```go\nconst (\n\tCONNECT = http.MethodConnect\n\tDELETE  = http.MethodDelete\n\tGET     = http.MethodGet\n\tHEAD    = http.MethodHead\n\tOPTIONS = http.MethodOptions\n\tPATCH   = http.MethodPatch\n\tPOST    = http.MethodPost\n\t// PROPFIND = \"PROPFIND\"\n\tPUT   = http.MethodPut\n\tTRACE = http.MethodTrace\n)\n```\nHTTP methods NOTE: Deprecated, please use the stdlib constants directly instead.\n\n```go\nconst (\n\tMIMEApplicationJSON                  = \"application/json\"\n\tMIMEApplicationJSONCharsetUTF8       = MIMEApplicationJSON + \"; \" + charsetUTF8\n\tMIMEApplicationJavaScript            = \"application/javascript\"\n\tMIMEApplicationJavaScriptCharsetUTF8 = MIMEApplicationJavaScript + \"; \" + charsetUTF8\n\tMIMEApplicationXML                   = \"application/xml\"\n\tMIMEApplicationXMLCharsetUTF8        = MIMEApplicationXML + \"; \" + charsetUTF8\n\tMIMETextXML                          = \"text/xml\"\n\tMIMETextXMLCharsetUTF8               = MIMETextXML + \"; \" + charsetUTF8\n\tMIMEApplicationForm                  = \"application/x-www-form-urlencoded\"\n\tMIMEApplicationProtobuf              = \"application/protobuf\"\n\tMIMEApplicationMsgpack               = \"application/msgpack\"\n\tMIMETextHTML                         = \"text/html\"\n\tMIMETextHTMLCharsetUTF8              = MIMETextHTML + \"; \" + charsetUTF8\n\tMIMETextPlain                        = \"text/plain\"\n\tMIMETextPlainCharsetUTF8             = MIMETextPlain + \"; \" + charsetUTF8\n\tMIMEMultipartForm                    = \"multipart/form-data\"\n\tMIMEOctetStream                      = \"application/octet-stream\"\n)\n```\nMIME types\n\n```go\nconst (\n\tHeaderAccept              = \"Accept\"\n\tHeaderAcceptEncoding      = \"Accept-Encoding\"\n\tHeaderAllow               = \"Allow\"\n\tHeaderAuthorization       = \"Authorization\"\n\tHeaderContentDisposition  = \"Content-Disposition\"\n\tHeaderContentEncoding     = \"Content-Encoding\"\n\tHeaderContentLength       = \"Content-Length\"\n\tHeaderContentType         = \"Content-Type\"\n\tHeaderCookie              = \"Cookie\"\n\tHeaderSetCookie           = \"Set-Cookie\"\n\tHeaderIfModifiedSince     = \"If-Modified-Since\"\n\tHeaderLastModified        = \"Last-Modified\"\n\tHeaderLocation            = \"Location\"\n\tHeaderUpgrade             = \"Upgrade\"\n\tHeaderVary                = \"Vary\"\n\tHeaderWWWAuthenticate     = \"WWW-Authenticate\"\n\tHeaderXForwardedFor       = \"X-Forwarded-For\"\n\tHeaderXForwardedProto     = \"X-Forwarded-Proto\"\n\tHeaderXForwardedProtocol  = \"X-Forwarded-Protocol\"\n\tHeaderXForwardedSsl       = \"X-Forwarded-Ssl\"\n\tHeaderXUrlScheme          = \"X-Url-Scheme\"\n\tHeaderXHTTPMethodOverride = \"X-HTTP-Method-Override\"\n\tHeaderXRealIP             = \"X-Real-IP\"\n\tHeaderXRequestID          = \"X-Request-ID\"\n\tHeaderXRequestedWith      = \"X-Requested-With\"\n\tHeaderServer              = \"Server\"\n\tHeaderOrigin              = \"Origin\"\n\n\t// Access control\n\tHeaderAccessControlRequestMethod    = \"Access-Control-Request-Method\"\n\tHeaderAccessControlRequestHeaders   = \"Access-Control-Request-Headers\"\n\tHeaderAccessControlAllowOrigin      = \"Access-Control-Allow-Origin\"\n\tHeaderAccessControlAllowMethods     = \"Access-Control-Allow-Methods\"\n\tHeaderAccessControlAllowHeaders     = \"Access-Control-Allow-Headers\"\n\tHeaderAccessControlAllowCredentials = \"Access-Control-Allow-Credentials\"\n\tHeaderAccessControlExposeHeaders    = \"Access-Control-Expose-Headers\"\n\tHeaderAccessControlMaxAge           = \"Access-Control-Max-Age\"\n\n\t// Security\n\tHeaderStrictTransportSecurity = \"Strict-Transport-Security\"\n\tHeaderXContentTypeOptions     = \"X-Content-Type-Options\"\n\tHeaderXXSSProtection          = \"X-XSS-Protection\"\n\tHeaderXFrameOptions           = \"X-Frame-Options\"\n\tHeaderContentSecurityPolicy   = \"Content-Security-Policy\"\n\tHeaderXCSRFToken              = \"X-CSRF-Token\"\n)\n```\nHeaders\n\n```go\nconst (\n\n\t// PROPFIND Method can be used on collection and property resources.\n\tPROPFIND = \"PROPFIND\"\n)\n```\n\n```go\nconst (\n\t// Version of Echo\n\tVersion = \"3.3.10-dev\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrUnsupportedMediaType        = NewHTTPError(http.StatusUnsupportedMediaType)\n\tErrNotFound                    = NewHTTPError(http.StatusNotFound)\n\tErrUnauthorized                = NewHTTPError(http.StatusUnauthorized)\n\tErrForbidden                   = NewHTTPError(http.StatusForbidden)\n\tErrMethodNotAllowed            = NewHTTPError(http.StatusMethodNotAllowed)\n\tErrStatusRequestEntityTooLarge = NewHTTPError(http.StatusRequestEntityTooLarge)\n\tErrTooManyRequests             = NewHTTPError(http.StatusTooManyRequests)\n\tErrBadRequest                  = NewHTTPError(http.StatusBadRequest)\n\tErrBadGateway                  = NewHTTPError(http.StatusBadGateway)\n\tErrInternalServerError         = NewHTTPError(http.StatusInternalServerError)\n\tErrRequestTimeout              = NewHTTPError(http.StatusRequestTimeout)\n\tErrServiceUnavailable          = NewHTTPError(http.StatusServiceUnavailable)\n\tErrValidatorNotRegistered      = errors.New(\"validator not registered\")\n\tErrRendererNotRegistered       = errors.New(\"renderer not registered\")\n\tErrInvalidRedirectCode         = errors.New(\"invalid redirect status code\")\n\tErrCookieNotFound              = errors.New(\"cookie not found\")\n)\n```\nErrors\n\n```go\nvar (\n\tNotFoundHandler = func(c Context) error {\n\t\treturn ErrNotFound\n\t}\n\n\tMethodNotAllowedHandler = func(c Context) error {\n\t\treturn ErrMethodNotAllowed\n\t}\n)\n```\nError handlers\n\n## Types\n\n```go\ntype BindUnmarshaler interface {\n\t// UnmarshalParam decodes and assigns a value from an form or query param.\n\tUnmarshalParam(param string) error\n}\n```\nBindUnmarshaler is the interface used to wrap the UnmarshalParam method.\n\n```go\ntype Binder interface {\n\tBind(i interface{}, c Context) error\n}\n```\nBinder is the interface that wraps the Bind method.\n\n```go\ntype Context interface {\n\t// Request returns `*http.Request`.\n\tRequest() *http.Request\n\n\t// SetRequest sets `*http.Request`.\n\tSetRequest(r *http.Request)\n\n\t// Response returns `*Response`.\n\tResponse() *Response\n\n\t// IsTLS returns true if HTTP connection is TLS otherwise false.\n\tIsTLS() bool\n\n\t// IsWebSocket returns true if HTTP connection is WebSocket otherwise false.\n\tIsWebSocket() bool\n\n\t// Scheme returns the HTTP protocol scheme, `http` or `https`.\n\tScheme() string\n\n\t// RealIP returns the client's network address based on `X-Forwarded-For`\n\t// or `X-Real-IP` request header.\n\tRealIP() string\n\n\t// Path returns the registered path for the handler.\n\tPath() string\n\n\t// SetPath sets the registered path for the handler.\n\tSetPath(p string)\n\n\t// Param returns path parameter by name.\n\tParam(name string) string\n\n\t// ParamNames returns path parameter names.\n\tParamNames() []string\n\n\t// SetParamNames sets path parameter names.\n\tSetParamNames(names ...string)\n\n\t// ParamValues returns path parameter values.\n\tParamValues() []string\n\n\t// SetParamValues sets path parameter values.\n\tSetParamValues(values ...string)\n\n\t// QueryParam returns the query param for the provided name.\n\tQueryParam(name string) string\n\n\t// QueryParams returns the query parameters as `url.Values`.\n\tQueryParams() url.Values\n\n\t// QueryString returns the URL query string.\n\tQueryString() string\n\n\t// FormValue returns the form field value for the provided name.\n\tFormValue(name string) string\n\n\t// FormParams returns the form parameters as `url.Values`.\n\tFormParams() (url.Values, error)\n\n\t// FormFile returns the multipart form file for the provided name.\n\tFormFile(name string) (*multipart.FileHeader, error)\n\n\t// MultipartForm returns the multipart form.\n\tMultipartForm() (*multipart.Form, error)\n\n\t// Cookie returns the named cookie provided in the request.\n\tCookie(name string) (*http.Cookie, error)\n\n\t// SetCookie adds a `Set-Cookie` header in HTTP response.\n\tSetCookie(cookie *http.Cookie)\n\n\t// Cookies returns the HTTP cookies sent with the request.\n\tCookies() []*http.Cookie\n\n\t// Get retrieves data from the context.\n\tGet(key string) interface{}\n\n\t// Set saves data in the context.\n\tSet(key string, val interface{})\n\n\t// Bind binds the request body into provided type `i`. The default binder\n\t// does it based on Content-Type header.\n\tBind(i interface{}) error\n\n\t// Validate validates provided `i`. It is usually called after `Context#Bind()`.\n\t// Validator must be registered using `Echo#Validator`.\n\tValidate(i interface{}) error\n\n\t// Render renders a template with data and sends a text/html response with status\n\t// code. Renderer must be registered using `Echo.Renderer`.\n\tRender(code int, name string, data interface{}) error\n\n\t// HTML sends an HTTP response with status code.\n\tHTML(code int, html string) error\n\n\t// HTMLBlob sends an HTTP blob response with status code.\n\tHTMLBlob(code int, b []byte) error\n\n\t// String sends a string response with status code.\n\tString(code int, s string) error\n\n\t// JSON sends a JSON response with status code.\n\tJSON(code int, i interface{}) error\n\n\t// JSONPretty sends a pretty-print JSON with status code.\n\tJSONPretty(code int, i interface{}, indent string) error\n\n\t// JSONBlob sends a JSON blob response with status code.\n\tJSONBlob(code int, b []byte) error\n\n\t// JSONP sends a JSONP response with status code. It uses `callback` to construct\n\t// the JSONP payload.\n\tJSONP(code int, callback string, i interface{}) error\n\n\t// JSONPBlob sends a JSONP blob response with status code. It uses `callback`\n\t// to construct the JSONP payload.\n\tJSONPBlob(code int, callback string, b []byte) error\n\n\t// XML sends an XML response with status code.\n\tXML(code int, i interface{}) error\n\n\t// XMLPretty sends a pretty-print XML with status code.\n\tXMLPretty(code int, i interface{}, indent string) error\n\n\t// XMLBlob sends an XML blob response with status code.\n\tXMLBlob(code int, b []byte) error\n\n\t// Blob sends a blob response with status code and content type.\n\tBlob(code int, contentType string, b []byte) error\n\n\t// Stream sends a streaming response with status code and content type.\n\tStream(code int, contentType string, r io.Reader) error\n\n\t// File sends a response with the content of the file.\n\tFile(file string) error\n\n\t// Attachment sends a response as attachment, prompting client to save the\n\t// file.\n\tAttachment(file string, name string) error\n\n\t// Inline sends a response as inline, opening the file in the browser.\n\tInline(file string, name string) error\n\n\t// NoContent sends a response with no body and a status code.\n\tNoContent(code int) error\n\n\t// Redirect redirects the request to a provided URL with status code.\n\tRedirect(code int, url string) error\n\n\t// Error invokes the registered HTTP error handler. Generally used by middleware.\n\tError(err error)\n\n\t// Handler returns the matched handler by router.\n\tHandler() HandlerFunc\n\n\t// SetHandler sets the matched handler by router.\n\tSetHandler(h HandlerFunc)\n\n\t// Logger returns the `Logger` instance.\n\tLogger() Logger\n\n\t// Echo returns the `Echo` instance.\n\tEcho() *Echo\n\n\t// Reset resets the context after request completes. It must be called along\n\t// with `Echo#AcquireContext()` and `Echo#ReleaseContext()`.\n\t// See `Echo#ServeHTTP()`\n\tReset(r *http.Request, w http.ResponseWriter)\n}\n```\nContext represents the context of the current HTTP request. It holds request and response objects, path, path parameters, data and registered handler.\n\n```go\ntype DefaultBinder struct{}\n```\nDefaultBinder is the default implementation of the Binder interface.\n\n```go\nfunc (b *DefaultBinder) Bind(i interface{}, c Context) (err error)\n```\nBind implements the \\`Binder#Bind\\` function.\n\n```go\ntype Echo struct {\n\tStdLogger *stdLog.Logger\n\n\tServer           *http.Server\n\tTLSServer        *http.Server\n\tListener         net.Listener\n\tTLSListener      net.Listener\n\tAutoTLSManager   autocert.Manager\n\tDisableHTTP2     bool\n\tDebug            bool\n\tHideBanner       bool\n\tHidePort         bool\n\tHTTPErrorHandler HTTPErrorHandler\n\tBinder           Binder\n\tValidator        Validator\n\tRenderer         Renderer\n\tLogger           Logger\n\t// contains filtered or unexported fields\n}\n```\nEcho is the top-level framework instance.\n\n```go\nfunc New() (e *Echo)\n```\nNew creates an instance of Echo.\n\n```go\nfunc (e *Echo) AcquireContext() Context\n```\nAcquireContext returns an empty \\`Context\\` instance from the pool. You must return the context by calling \\`ReleaseContext()\\`.\n\n```go\nfunc (e *Echo) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route\n```\nAdd registers a new route for an HTTP method and path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route\n```\nAny registers a new route for all HTTP methods and path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) CONNECT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nCONNECT registers a new CONNECT route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) Close() error\n```\nClose immediately stops the server. It internally calls \\`http.Server#Close()\\`.\n\n```go\nfunc (e *Echo) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nDELETE registers a new DELETE route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) DefaultHTTPErrorHandler(err error, c Context)\n```\nDefaultHTTPErrorHandler is the default HTTP error handler. It sends a JSON response with status code.\n\n```go\nfunc (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route\n```\nFile registers a new route with path to serve a static file with optional route-level middleware.\n\n```go\nfunc (e *Echo) GET(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nGET registers a new GET route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) Group(prefix string, m ...MiddlewareFunc) (g *Group)\n```\nGroup creates a new router group with prefix and optional group-level middleware.\n\n```go\nfunc (e *Echo) HEAD(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nHEAD registers a new HEAD route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) Match(methods []string, path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route\n```\nMatch registers a new route for multiple HTTP methods and path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context\n```\nNewContext returns a Context instance.\n\n```go\nfunc (e *Echo) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nOPTIONS registers a new OPTIONS route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) PATCH(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPATCH registers a new PATCH route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) POST(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPOST registers a new POST route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) PUT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPUT registers a new PUT route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) Pre(middleware ...MiddlewareFunc)\n```\nPre adds middleware to the chain which is run before router.\n\n```go\nfunc (e *Echo) ReleaseContext(c Context)\n```\nReleaseContext returns the \\`Context\\` instance back to the pool. You must call it after \\`AcquireContext()\\`.\n\n```go\nfunc (e *Echo) Reverse(name string, params ...interface{}) string\n```\nReverse generates an URL from route name and provided parameters.\n\n```go\nfunc (e *Echo) Router() *Router\n```\nRouter returns router.\n\n```go\nfunc (e *Echo) Routes() []*Route\n```\nRoutes returns the registered routes.\n\n```go\nfunc (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\nServeHTTP implements \\`http.Handler\\` interface, which serves HTTP requests.\n\n```go\nfunc (e *Echo) Shutdown(ctx stdContext.Context) error\n```\nShutdown stops the server gracefully. It internally calls \\`http.Server#Shutdown()\\`.\n\n```go\nfunc (e *Echo) Start(address string) error\n```\nStart starts an HTTP server.\n\n```go\nfunc (e *Echo) StartAutoTLS(address string) error\n```\nStartAutoTLS starts an HTTPS server using certificates automatically installed from [https://letsencrypt.org](https://letsencrypt.org).\n\n```go\nfunc (e *Echo) StartServer(s *http.Server) (err error)\n```\nStartServer starts a custom http server.\n\n```go\nfunc (e *Echo) StartTLS(address string, certFile, keyFile string) (err error)\n```\nStartTLS starts an HTTPS server.\n\n```go\nfunc (e *Echo) Static(prefix, root string) *Route\n```\nStatic registers a new route with path prefix to serve static files from the provided root directory.\n\n```go\nfunc (e *Echo) TRACE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nTRACE registers a new TRACE route for a path with matching handler in the router with optional route-level middleware.\n\n```go\nfunc (e *Echo) URI(handler HandlerFunc, params ...interface{}) string\n```\nURI generates a URI from handler.\n\n```go\nfunc (e *Echo) URL(h HandlerFunc, params ...interface{}) string\n```\nURL is an alias for \\`URI\\` function.\n\n```go\nfunc (e *Echo) Use(middleware ...MiddlewareFunc)\n```\nUse adds middleware to the chain which is run after router.\n\n```go\ntype Group struct {\n\t// contains filtered or unexported fields\n}\n```\nGroup is a set of sub-routes for a specified route. It can be used for inner routes that share a common middleware or functionality that should be separate from the parent echo instance while still inheriting from it.\n\n```go\nfunc (g *Group) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route\n```\nAdd implements \\`Echo#Add()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route\n```\nAny implements \\`Echo#Any()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) CONNECT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nCONNECT implements \\`Echo#CONNECT()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nDELETE implements \\`Echo#DELETE()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) File(path, file string)\n```\nFile implements \\`Echo#File()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) GET(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nGET implements \\`Echo#GET()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) Group(prefix string, middleware ...MiddlewareFunc) *Group\n```\nGroup creates a new sub-group with prefix and optional sub-group-level middleware.\n\n```go\nfunc (g *Group) HEAD(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nHEAD implements \\`Echo#HEAD()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) Match(methods []string, path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route\n```\nMatch implements \\`Echo#Match()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nOPTIONS implements \\`Echo#OPTIONS()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) PATCH(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPATCH implements \\`Echo#PATCH()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) POST(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPOST implements \\`Echo#POST()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) PUT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nPUT implements \\`Echo#PUT()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) Static(prefix, root string)\n```\nStatic implements \\`Echo#Static()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) TRACE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route\n```\nTRACE implements \\`Echo#TRACE()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) Use(middleware ...MiddlewareFunc)\n```\nUse implements \\`Echo#Use()\\` for sub-routes within the Group.\n\n```go\ntype HTTPError struct {\n\tCode     int\n\tMessage  interface{}\n\tInternal error // Stores the error returned by an external dependency\n}\n```\nHTTPError represents an error that occurred while handling a request.\n\n```go\nfunc NewHTTPError(code int, message ...interface{}) *HTTPError\n```\nNewHTTPError creates a new HTTPError instance.\n\n```go\nfunc (he *HTTPError) Error() string\n```\nError makes it compatible with \\`error\\` interface.\n\n```go\nfunc (he *HTTPError) SetInternal(err error) *HTTPError\n```\nSetInternal sets error to HTTPError.Internal\n\n```go\ntype HTTPErrorHandler func(error, Context)\n```\nHTTPErrorHandler is a centralized HTTP error handler.\n\n```go\ntype HandlerFunc func(Context) error\n```\nHandlerFunc defines a function to serve HTTP requests.\n\n```go\nfunc WrapHandler(h http.Handler) HandlerFunc\n```\nWrapHandler wraps \\`http.Handler\\` into \\`echo.HandlerFunc\\`.\n\n```go\ntype Logger interface {\n\tOutput() io.Writer\n\tSetOutput(w io.Writer)\n\tPrefix() string\n\tSetPrefix(p string)\n\tLevel() log.Lvl\n\tSetLevel(v log.Lvl)\n\tSetHeader(h string)\n\tPrint(i ...interface{})\n\tPrintf(format string, args ...interface{})\n\tPrintj(j log.JSON)\n\tDebug(i ...interface{})\n\tDebugf(format string, args ...interface{})\n\tDebugj(j log.JSON)\n\tInfo(i ...interface{})\n\tInfof(format string, args ...interface{})\n\tInfoj(j log.JSON)\n\tWarn(i ...interface{})\n\tWarnf(format string, args ...interface{})\n\tWarnj(j log.JSON)\n\tError(i ...interface{})\n\tErrorf(format string, args ...interface{})\n\tErrorj(j log.JSON)\n\tFatal(i ...interface{})\n\tFatalj(j log.JSON)\n\tFatalf(format string, args ...interface{})\n\tPanic(i ...interface{})\n\tPanicj(j log.JSON)\n\tPanicf(format string, args ...interface{})\n}\n```\nLogger defines the logging interface.\n\n```go\ntype Map map[string]interface{}\n```\nMap defines a generic map of type \\`map\\[string]interface{}\\`.\n\n```go\ntype MiddlewareFunc func(HandlerFunc) HandlerFunc\n```\nMiddlewareFunc defines a function to process middleware.\n\n```go\nfunc WrapMiddleware(m func(http.Handler) http.Handler) MiddlewareFunc\n```\nWrapMiddleware wraps \\`func(http.Handler) http.Handler\\` into \\`echo.MiddlewareFunc\\`\n\n```go\ntype Renderer interface {\n\tRender(io.Writer, string, interface{}, Context) error\n}\n```\nRenderer is the interface that wraps the Render function.\n\n```go\ntype Response struct {\n\tWriter    http.ResponseWriter\n\tStatus    int\n\tSize      int64\n\tCommitted bool\n\t// contains filtered or unexported fields\n}\n```\nResponse wraps an http.ResponseWriter and implements its interface to be used by an HTTP handler to construct an HTTP response. See: [https://golang.org/pkg/net/http/#ResponseWriter](https://golang.org/pkg/net/http/#ResponseWriter)\n\n```go\nfunc NewResponse(w http.ResponseWriter, e *Echo) (r *Response)\n```\nNewResponse creates a new instance of Response.\n\n```go\nfunc (r *Response) After(fn func())\n```\nAfter registers a function which is called just after the response is written. If the \\`Content-Length\\` is unknown, none of the after function is executed.\n\n```go\nfunc (r *Response) Before(fn func())\n```\nBefore registers a function which is called just before the response is written.\n\n```go\nfunc (r *Response) CloseNotify() \u003c-chan bool\n```\nCloseNotify implements the http.CloseNotifier interface to allow detecting when the underlying connection has gone away. This mechanism can be used to cancel long operations on the server if the client has disconnected before the response is ready. See [http.CloseNotifier](/net/http#CloseNotifier)([https://golang.org/pkg/net/http/#CloseNotifier](https://golang.org/pkg/net/http/#CloseNotifier))\n\n```go\nfunc (r *Response) Flush()\n```\nFlush implements the http.Flusher interface to allow an HTTP handler to flush buffered data to the client. See [http.Flusher](/net/http#Flusher)([https://golang.org/pkg/net/http/#Flusher](https://golang.org/pkg/net/http/#Flusher))\n\n```go\nfunc (r *Response) Header() http.Header\n```\nHeader returns the header map for the writer that will be sent by WriteHeader. Changing the header after a call to WriteHeader (or Write) has no effect unless the modified headers were declared as trailers by setting the \"Trailer\" header before the call to WriteHeader (see example) To suppress implicit response headers, set their value to nil. Example: [https://golang.org/pkg/net/http/#example\\_ResponseWriter\\_trailers](https://golang.org/pkg/net/http/#example_ResponseWriter_trailers)\n\n```go\nfunc (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error)\n```\nHijack implements the http.Hijacker interface to allow an HTTP handler to take over the connection. See [http.Hijacker](/net/http#Hijacker)([https://golang.org/pkg/net/http/#Hijacker](https://golang.org/pkg/net/http/#Hijacker))\n\n```go\nfunc (r *Response) Write(b []byte) (n int, err error)\n```\nWrite writes the data to the connection as part of an HTTP reply.\n\n```go\nfunc (r *Response) WriteHeader(code int)\n```\nWriteHeader sends an HTTP response header with status code. If WriteHeader is not called explicitly, the first call to Write will trigger an implicit WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly used to send error codes.\n\n```go\ntype Route struct {\n\tMethod string `json:\"method\"`\n\tPath   string `json:\"path\"`\n\tName   string `json:\"name\"`\n}\n```\nRoute contains a handler and information for matching against requests.\n\n```go\ntype Router struct {\n\t// contains filtered or unexported fields\n}\n```\nRouter is the registry of all registered routes for an \\`Echo\\` instance for request matching and URL path parameter parsing.\n\n```go\nfunc NewRouter(e *Echo) *Router\n```\nNewRouter returns a new Router instance.\n\n```go\nfunc (r *Router) Add(method, path string, h HandlerFunc)\n```\nAdd registers a new route for method and path with matching handler.\n\n```go\nfunc (r *Router) Find(method, path string, c Context)\n```\nFind lookup a handler registered for method and path. It also parses URL for path parameters and load them into context.\n\nFor performance:\n\n\\- Get context from \\`Echo#AcquireContext()\\` - Reset it \\`Context#Reset()\\` - Return it \\`Echo#ReleaseContext()\\`.\n\n```go\ntype Validator interface {\n\tValidate(i interface{}) error\n}\n```\nValidator is the interface that wraps the Validate function.\n\n","path":"github.com/labstack/echo","name":"echo","synopsis":"Package echo implements high performance, minimalist Go web framework.","isRedistributable":true}
