{"modulePath":"github.com/Code-Hex/echo","version":"v3.0.3+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 = \"CONNECT\"\n\tDELETE  = \"DELETE\"\n\tGET     = \"GET\"\n\tHEAD    = \"HEAD\"\n\tOPTIONS = \"OPTIONS\"\n\tPATCH   = \"PATCH\"\n\tPOST    = \"POST\"\n\tPUT     = \"PUT\"\n\tTRACE   = \"TRACE\"\n)\n```\nHTTP methods\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\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\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\tHeaderXForwardedProto               = \"X-Forwarded-Proto\"\n\tHeaderXHTTPMethodOverride           = \"X-HTTP-Method-Override\"\n\tHeaderXForwardedFor                 = \"X-Forwarded-For\"\n\tHeaderXRealIP                       = \"X-Real-IP\"\n\tHeaderServer                        = \"Server\"\n\tHeaderOrigin                        = \"Origin\"\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## Variables\n\n```go\nvar (\n\tErrUnsupportedMediaType        = NewHTTPError(http.StatusUnsupportedMediaType)\n\tErrNotFound                    = NewHTTPError(http.StatusNotFound)\n\tErrUnauthorized                = NewHTTPError(http.StatusUnauthorized)\n\tErrMethodNotAllowed            = NewHTTPError(http.StatusMethodNotAllowed)\n\tErrStatusRequestEntityTooLarge = NewHTTPError(http.StatusRequestEntityTooLarge)\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 Binder interface {\n\tBind(interface{}, 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(*http.Request)\n\n\t// Request returns `*Response`.\n\tResponse() *Response\n\n\t// IsTLS returns true if HTTP connection is TLS otherwise false.\n\tIsTLS() 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(string)\n\n\t// Param returns path parameter by name.\n\tParam(string) string\n\n\t// ParamNames returns path parameter names.\n\tParamNames() []string\n\n\t// SetParamNames sets path parameter names.\n\tSetParamNames(...string)\n\n\t// ParamValues returns path parameter values.\n\tParamValues() []string\n\n\t// SetParamValues sets path parameter values.\n\tSetParamValues(...string)\n\n\t// QueryParam returns the query param for the provided name.\n\tQueryParam(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(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(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(string) (*http.Cookie, error)\n\n\t// SetCookie adds a `Set-Cookie` header in HTTP response.\n\tSetCookie(*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(string) interface{}\n\n\t// Set saves data in the context.\n\tSet(string, 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(interface{}) error\n\n\t// Render renders a template with data and sends a text/html response with status\n\t// code. Templates can be registered using `Echo.Renderer`.\n\tRender(int, string, interface{}) error\n\n\t// HTML sends an HTTP response with status code.\n\tHTML(int, string) error\n\n\t// String sends a string response with status code.\n\tString(int, string) error\n\n\t// JSON sends a JSON response with status code.\n\tJSON(int, interface{}) error\n\n\t// JSONBlob sends a JSON blob response with status code.\n\tJSONBlob(int, []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(int, string, 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(int, string, []byte) error\n\n\t// XML sends an XML response with status code.\n\tXML(int, interface{}) error\n\n\t// XMLBlob sends a XML blob response with status code.\n\tXMLBlob(int, []byte) error\n\n\t// Blob sends a blob response with status code and content type.\n\tBlob(int, string, []byte) error\n\n\t// Stream sends a streaming response with status code and content type.\n\tStream(int, string, io.Reader) error\n\n\t// File sends a response with the content of the file.\n\tFile(string) error\n\n\t// Attachment sends a response as attachment, prompting client to save the\n\t// file.\n\tAttachment(string, string) error\n\n\t// Inline sends a response as inline, opening the file in the browser.\n\tInline(string, string) error\n\n\t// NoContent sends a response with no body and a status code.\n\tNoContent(int) error\n\n\t// Redirect redirects the request with status code.\n\tRedirect(int, 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(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(*http.Request, 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 Echo struct {\n\tDisableHTTP2 bool\n\tDebug        bool\n\tHTTPErrorHandler\n\tBinder          Binder\n\tRenderer        Renderer\n\tAutoTLSManager  autocert.Manager\n\tShutdownTimeout time.Duration\n\tColor           *color.Color\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) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc)\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)\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) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc)\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 invokes the default HTTP error handler.\n\n```go\nfunc (e *Echo) File(path, file string)\n```\nFile registers a new route with path to serve a static file.\n\n```go\nfunc (e *Echo) GET(path string, h HandlerFunc, m ...MiddlewareFunc)\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)\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)\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)\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)\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)\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)\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) 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(timeout time.Duration)\n```\nShutdown gracefully shutdown the HTTP server with timeout.\n\n```go\nfunc (e *Echo) ShutdownTLS(timeout time.Duration)\n```\nShutdownTLS gracefully shutdown the TLS server with timeout.\n\n```go\nfunc (e *Echo) Start(address string) error\n```\nStart starts the HTTP server.\n\n```go\nfunc (e *Echo) StartAutoTLS(address string) error\n```\nStartAutoTLS starts the HTTPS server using certificates automatically from [https://letsencrypt.org](https://letsencrypt.org).\n\n```go\nfunc (e *Echo) StartServer(s *http.Server) error\n```\nStartServer runs a custom HTTP server.\n\n```go\nfunc (e *Echo) StartTLS(address string, certFile, keyFile string) (err error)\n```\nStartTLS starts the HTTPS server.\n\n```go\nfunc (e *Echo) Static(prefix, root string)\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)\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 middlware or functionality that should be separate from the parent echo instance while still inheriting from it.\n\n```go\nfunc (g *Group) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc)\n```\nAny implements \\`Echo#Any()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) CONNECT(path string, h HandlerFunc, m ...MiddlewareFunc)\n```\nCONNECT implements \\`Echo#CONNECT()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc)\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)\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)\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)\n```\nMatch implements \\`Echo#Match()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc)\n```\nOPTIONS implements \\`Echo#OPTIONS()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) PATCH(path string, h HandlerFunc, m ...MiddlewareFunc)\n```\nPATCH implements \\`Echo#PATCH()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) POST(path string, h HandlerFunc, m ...MiddlewareFunc)\n```\nPOST implements \\`Echo#POST()\\` for sub-routes within the Group.\n\n```go\nfunc (g *Group) PUT(path string, h HandlerFunc, m ...MiddlewareFunc)\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)\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 string\n}\n```\nHTTPError represents an error that occurred while handling a request.\n\n```go\nfunc NewHTTPError(code int, msg ...interface{}) *HTTPError\n```\nNewHTTPError creates a new HTTPError instance.\n\n```go\nfunc (e *HTTPError) Error() string\n```\nError makes it compatible with \\`error\\` interface.\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 server 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(io.Writer)\n\tLevel() log.Lvl\n\tSetLevel(log.Lvl)\n\tPrefix() string\n\tSetPrefix(string)\n\tPrint(...interface{})\n\tPrintf(string, ...interface{})\n\tPrintj(log.JSON)\n\tDebug(...interface{})\n\tDebugf(string, ...interface{})\n\tDebugj(log.JSON)\n\tInfo(...interface{})\n\tInfof(string, ...interface{})\n\tInfoj(log.JSON)\n\tWarn(...interface{})\n\tWarnf(string, ...interface{})\n\tWarnj(log.JSON)\n\tError(...interface{})\n\tErrorf(string, ...interface{})\n\tErrorj(log.JSON)\n\tFatal(...interface{})\n\tFatalj(log.JSON)\n\tFatalf(string, ...interface{})\n\tPanic(...interface{})\n\tPanicj(log.JSON)\n\tPanicf(string, ...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\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) 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) SetWriter(w http.ResponseWriter)\n```\nSetWriter sets the http.ResponseWriter instance for this Response.\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\nfunc (r *Response) Writer() http.ResponseWriter\n```\nWriter returns the http.ResponseWriter instance for this Response.\n\n```go\ntype Route struct {\n\tMethod  string\n\tPath    string\n\tHandler string\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, context Context)\n```\nFind lookup a handler registed 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() error\n}\n```\nValidator is the interface that wraps the Validate function.\n\n","path":"github.com/Code-Hex/echo","name":"echo","synopsis":"Package echo implements high performance, minimalist Go web framework.","isRedistributable":true}
