Versions in this module Expand all Collapse all v4 v4.1.18 Jul 10, 2020 Changes in this version + const CONNECT + const DELETE + const GET + const HEAD + const HeaderAccept + const HeaderAcceptEncoding + const HeaderAccessControlAllowCredentials + const HeaderAccessControlAllowHeaders + const HeaderAccessControlAllowMethods + const HeaderAccessControlAllowOrigin + const HeaderAccessControlExposeHeaders + const HeaderAccessControlMaxAge + const HeaderAccessControlRequestHeaders + const HeaderAccessControlRequestMethod + const HeaderAllow + const HeaderAuthorization + const HeaderContentDisposition + const HeaderContentEncoding + const HeaderContentLength + const HeaderContentSecurityPolicy + const HeaderContentSecurityPolicyReportOnly + const HeaderContentType + const HeaderCookie + const HeaderIfModifiedSince + const HeaderLastModified + const HeaderLocation + const HeaderOrigin + const HeaderReferrerPolicy + const HeaderServer + const HeaderSetCookie + const HeaderStrictTransportSecurity + const HeaderUpgrade + const HeaderVary + const HeaderWWWAuthenticate + const HeaderXCSRFToken + const HeaderXContentTypeOptions + const HeaderXForwardedFor + const HeaderXForwardedProto + const HeaderXForwardedProtocol + const HeaderXForwardedSsl + const HeaderXFrameOptions + const HeaderXHTTPMethodOverride + const HeaderXRealIP + const HeaderXRequestID + const HeaderXRequestedWith + const HeaderXUrlScheme + const HeaderXXSSProtection + const MIMEApplicationForm + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationJavaScript + const MIMEApplicationJavaScriptCharsetUTF8 + const MIMEApplicationMsgpack + const MIMEApplicationProtobuf + const MIMEApplicationXML + const MIMEApplicationXMLCharsetUTF8 + const MIMEMultipartForm + const MIMEOctetStream + const MIMETextHTML + const MIMETextHTMLCharsetUTF8 + const MIMETextPlain + const MIMETextPlainCharsetUTF8 + const MIMETextXML + const MIMETextXMLCharsetUTF8 + const OPTIONS + const PATCH + const POST + const PROPFIND + const PUT + const REPORT + const TRACE + const Version + var ErrBadGateway = NewHTTPError(http.StatusBadGateway) + var ErrBadRequest = NewHTTPError(http.StatusBadRequest) + var ErrCookieNotFound = errors.New("cookie not found") + var ErrForbidden = NewHTTPError(http.StatusForbidden) + var ErrInternalServerError = NewHTTPError(http.StatusInternalServerError) + var ErrInvalidCertOrKeyType = errors.New("invalid cert or key type, must be string or []byte") + var ErrInvalidRedirectCode = errors.New("invalid redirect status code") + var ErrMethodNotAllowed = NewHTTPError(http.StatusMethodNotAllowed) + var ErrNotFound = NewHTTPError(http.StatusNotFound) + var ErrRendererNotRegistered = errors.New("renderer not registered") + var ErrRequestTimeout = NewHTTPError(http.StatusRequestTimeout) + var ErrServiceUnavailable = NewHTTPError(http.StatusServiceUnavailable) + var ErrStatusRequestEntityTooLarge = NewHTTPError(http.StatusRequestEntityTooLarge) + var ErrTooManyRequests = NewHTTPError(http.StatusTooManyRequests) + var ErrUnauthorized = NewHTTPError(http.StatusUnauthorized) + var ErrUnsupportedMediaType = NewHTTPError(http.StatusUnsupportedMediaType) + var ErrValidatorNotRegistered = errors.New("validator not registered") + var MethodNotAllowedHandler = func(c Context) error + var NotFoundHandler = func(c Context) error + func GetPath(r *http.Request) string + type BindUnmarshaler interface + UnmarshalParam func(param string) error + type Binder interface + Bind func(i interface{}, c Context) error + type Context interface + Attachment func(file string, name string) error + Bind func(i interface{}) error + Blob func(code int, contentType string, b []byte) error + Cookie func(name string) (*http.Cookie, error) + Cookies func() []*http.Cookie + Echo func() *Echo + Error func(err error) + File func(file string) error + FormFile func(name string) (*multipart.FileHeader, error) + FormParams func() (url.Values, error) + FormValue func(name string) string + Get func(key string) interface{} + HTML func(code int, html string) error + HTMLBlob func(code int, b []byte) error + Handler func() HandlerFunc + Inline func(file string, name string) error + IsTLS func() bool + IsWebSocket func() bool + JSON func(code int, i interface{}) error + JSONBlob func(code int, b []byte) error + JSONP func(code int, callback string, i interface{}) error + JSONPBlob func(code int, callback string, b []byte) error + JSONPretty func(code int, i interface{}, indent string) error + Logger func() Logger + MultipartForm func() (*multipart.Form, error) + NoContent func(code int) error + Param func(name string) string + ParamNames func() []string + ParamValues func() []string + Path func() string + QueryParam func(name string) string + QueryParams func() url.Values + QueryString func() string + RealIP func() string + Redirect func(code int, url string) error + Render func(code int, name string, data interface{}) error + Request func() *http.Request + Reset func(r *http.Request, w http.ResponseWriter) + Response func() *Response + Scheme func() string + Set func(key string, val interface{}) + SetCookie func(cookie *http.Cookie) + SetHandler func(h HandlerFunc) + SetLogger func(l Logger) + SetParamNames func(names ...string) + SetParamValues func(values ...string) + SetPath func(p string) + SetRequest func(r *http.Request) + SetResponse func(r *Response) + Stream func(code int, contentType string, r io.Reader) error + String func(code int, s string) error + Validate func(i interface{}) error + XML func(code int, i interface{}) error + XMLBlob func(code int, b []byte) error + XMLPretty func(code int, i interface{}, indent string) error + type DefaultBinder struct + func (b *DefaultBinder) Bind(i interface{}, c Context) (err error) + type Echo struct + AutoTLSManager autocert.Manager + Binder Binder + Debug bool + DisableHTTP2 bool + HTTPErrorHandler HTTPErrorHandler + HideBanner bool + HidePort bool + IPExtractor IPExtractor + Listener net.Listener + Logger Logger + Renderer Renderer + Server *http.Server + StdLogger *stdLog.Logger + TLSListener net.Listener + TLSServer *http.Server + Validator Validator + func New() (e *Echo) + func (e *Echo) AcquireContext() Context + func (e *Echo) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route + func (e *Echo) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route + func (e *Echo) CONNECT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) Close() error + func (e *Echo) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) + func (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route + func (e *Echo) GET(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) Group(prefix string, m ...MiddlewareFunc) (g *Group) + func (e *Echo) HEAD(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) Host(name string, m ...MiddlewareFunc) (g *Group) + func (e *Echo) Match(methods []string, path string, handler HandlerFunc, ...) []*Route + func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context + func (e *Echo) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) PATCH(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) POST(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) PUT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) Pre(middleware ...MiddlewareFunc) + func (e *Echo) ReleaseContext(c Context) + func (e *Echo) Reverse(name string, params ...interface{}) string + func (e *Echo) Router() *Router + func (e *Echo) Routers() map[string]*Router + func (e *Echo) Routes() []*Route + func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (e *Echo) Shutdown(ctx stdContext.Context) error + func (e *Echo) Start(address string) error + func (e *Echo) StartAutoTLS(address string) error + func (e *Echo) StartH2CServer(address string, h2s *http2.Server) (err error) + func (e *Echo) StartServer(s *http.Server) (err error) + func (e *Echo) StartTLS(address string, certFile, keyFile interface{}) (err error) + func (e *Echo) Static(prefix, root string) *Route + func (e *Echo) TRACE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (e *Echo) URI(handler HandlerFunc, params ...interface{}) string + func (e *Echo) URL(h HandlerFunc, params ...interface{}) string + func (e *Echo) Use(middleware ...MiddlewareFunc) + type Group struct + func (g *Group) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route + func (g *Group) Any(path string, handler HandlerFunc, middleware ...MiddlewareFunc) []*Route + func (g *Group) CONNECT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) File(path, file string) + func (g *Group) GET(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) (sg *Group) + func (g *Group) HEAD(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) Match(methods []string, path string, handler HandlerFunc, ...) []*Route + func (g *Group) OPTIONS(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) PATCH(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) POST(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) PUT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) Static(prefix, root string) + func (g *Group) TRACE(path string, h HandlerFunc, m ...MiddlewareFunc) *Route + func (g *Group) Use(middleware ...MiddlewareFunc) + type HTTPError struct + Code int + Internal error + Message interface{} + func NewHTTPError(code int, message ...interface{}) *HTTPError + func (he *HTTPError) Error() string + func (he *HTTPError) SetInternal(err error) *HTTPError + type HTTPErrorHandler func(error, Context) + type HandlerFunc func(Context) error + func WrapHandler(h http.Handler) HandlerFunc + type IPExtractor func(*http.Request) string + func ExtractIPDirect() IPExtractor + func ExtractIPFromRealIPHeader(options ...TrustOption) IPExtractor + func ExtractIPFromXFFHeader(options ...TrustOption) IPExtractor + type Logger interface + Debug func(i ...interface{}) + Debugf func(format string, args ...interface{}) + Debugj func(j log.JSON) + Error func(i ...interface{}) + Errorf func(format string, args ...interface{}) + Errorj func(j log.JSON) + Fatal func(i ...interface{}) + Fatalf func(format string, args ...interface{}) + Fatalj func(j log.JSON) + Info func(i ...interface{}) + Infof func(format string, args ...interface{}) + Infoj func(j log.JSON) + Level func() log.Lvl + Output func() io.Writer + Panic func(i ...interface{}) + Panicf func(format string, args ...interface{}) + Panicj func(j log.JSON) + Prefix func() string + Print func(i ...interface{}) + Printf func(format string, args ...interface{}) + Printj func(j log.JSON) + SetHeader func(h string) + SetLevel func(v log.Lvl) + SetOutput func(w io.Writer) + SetPrefix func(p string) + Warn func(i ...interface{}) + Warnf func(format string, args ...interface{}) + Warnj func(j log.JSON) + type Map map[string]interface + type MiddlewareFunc func(HandlerFunc) HandlerFunc + func WrapMiddleware(m func(http.Handler) http.Handler) MiddlewareFunc + type Renderer interface + Render func(io.Writer, string, interface{}, Context) error + type Response struct + Committed bool + Size int64 + Status int + Writer http.ResponseWriter + func NewResponse(w http.ResponseWriter, e *Echo) (r *Response) + func (r *Response) After(fn func()) + func (r *Response) Before(fn func()) + func (r *Response) Flush() + func (r *Response) Header() http.Header + func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (r *Response) Write(b []byte) (n int, err error) + func (r *Response) WriteHeader(code int) + type Route struct + Method string + Name string + Path string + type Router struct + func NewRouter(e *Echo) *Router + func (r *Router) Add(method, path string, h HandlerFunc) + func (r *Router) Find(method, path string, c Context) + type TrustOption func(*ipChecker) + func TrustIPRange(ipRange *net.IPNet) TrustOption + func TrustLinkLocal(v bool) TrustOption + func TrustLoopback(v bool) TrustOption + func TrustPrivateNet(v bool) TrustOption + type Validator interface + Validate func(i interface{}) error Other modules containing this package github.com/arun0009/echo