Versions in this module Expand all Collapse all v2 v2.2.2 Aug 15, 2024 v2.2.1 Aug 15, 2024 Changes in this version + const AlgorithmHS256 + const GZIPEncoding + const StatusCodeContextCanceled + var DefaultBasicAuthConfig = BasicAuthConfig + var DefaultBodyDumpConfig = BodyDumpConfig + var DefaultBodyLimitConfig = BodyLimitConfig + var DefaultCORSConfig = CORSConfig + var DefaultCSRFConfig = CSRFConfig + var DefaultDecompressConfig = DecompressConfig + var DefaultGzipConfig = GzipConfig + var DefaultJWTConfig = JWTConfig + var DefaultKeyAuthConfig = KeyAuthConfig + var DefaultLoggerConfig = LoggerConfig + var DefaultMethodOverrideConfig = MethodOverrideConfig + var DefaultProxyConfig = ProxyConfig + var DefaultRateLimiterConfig = RateLimiterConfig + var DefaultRateLimiterMemoryStoreConfig = RateLimiterMemoryStoreConfig + var DefaultRecoverConfig = RecoverConfig + var DefaultRedirectConfig = RedirectConfig + var DefaultRequestIDConfig = RequestIDConfig + var DefaultRewriteConfig = RewriteConfig + var DefaultSecureConfig = SecureConfig + var DefaultStaticConfig = StaticConfig + var DefaultTimeoutConfig = TimeoutConfig + var DefaultTrailingSlashConfig = TrailingSlashConfig + var ErrCSRFInvalid = echo.NewHTTPError(http.StatusForbidden, "invalid csrf token") + var ErrExtractorError = echo.NewHTTPError(http.StatusForbidden, "error while extracting identifier") + var ErrJWTInvalid = echo.NewHTTPError(http.StatusUnauthorized, "invalid or expired jwt") + var ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt") + var ErrRateLimitExceeded = echo.NewHTTPError(http.StatusTooManyRequests, "rate limit exceeded") + func AddTrailingSlash() echo.MiddlewareFunc + func AddTrailingSlashWithConfig(config TrailingSlashConfig) echo.MiddlewareFunc + func BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc + func BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc + func BodyDump(handler BodyDumpHandler) echo.MiddlewareFunc + func BodyDumpWithConfig(config BodyDumpConfig) echo.MiddlewareFunc + func BodyLimit(limit string) echo.MiddlewareFunc + func BodyLimitWithConfig(config BodyLimitConfig) echo.MiddlewareFunc + func CORS() echo.MiddlewareFunc + func CORSWithConfig(config CORSConfig) echo.MiddlewareFunc + func CSRF() echo.MiddlewareFunc + func CSRFWithConfig(config CSRFConfig) echo.MiddlewareFunc + func ContextTimeout(timeout time.Duration) echo.MiddlewareFunc + func ContextTimeoutWithConfig(config ContextTimeoutConfig) echo.MiddlewareFunc + func Decompress() echo.MiddlewareFunc + func DecompressWithConfig(config DecompressConfig) echo.MiddlewareFunc + func DefaultSkipper(echo.Context) bool + func Gzip() echo.MiddlewareFunc + func GzipWithConfig(config GzipConfig) echo.MiddlewareFunc + func HTTPSNonWWWRedirect() echo.MiddlewareFunc + func HTTPSNonWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc + func HTTPSRedirect() echo.MiddlewareFunc + func HTTPSRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc + func HTTPSWWWRedirect() echo.MiddlewareFunc + func HTTPSWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc + func JWT(key interface{}) echo.MiddlewareFunc + func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc + func KeyAuth(fn KeyAuthValidator) echo.MiddlewareFunc + func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc + func Logger() echo.MiddlewareFunc + func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc + func MethodOverride() echo.MiddlewareFunc + func MethodOverrideWithConfig(config MethodOverrideConfig) echo.MiddlewareFunc + func NonWWWRedirect() echo.MiddlewareFunc + func NonWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc + func Proxy(balancer ProxyBalancer) echo.MiddlewareFunc + func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc + func RateLimiter(store RateLimiterStore) echo.MiddlewareFunc + func RateLimiterWithConfig(config RateLimiterConfig) echo.MiddlewareFunc + func Recover() echo.MiddlewareFunc + func RecoverWithConfig(config RecoverConfig) echo.MiddlewareFunc + func RemoveTrailingSlash() echo.MiddlewareFunc + func RemoveTrailingSlashWithConfig(config TrailingSlashConfig) echo.MiddlewareFunc + func RequestID() echo.MiddlewareFunc + func RequestIDWithConfig(config RequestIDConfig) echo.MiddlewareFunc + func RequestLoggerWithConfig(config RequestLoggerConfig) echo.MiddlewareFunc + func Rewrite(rules map[string]string) echo.MiddlewareFunc + func RewriteWithConfig(config RewriteConfig) echo.MiddlewareFunc + func Secure() echo.MiddlewareFunc + func SecureWithConfig(config SecureConfig) echo.MiddlewareFunc + func Static(root string) echo.MiddlewareFunc + func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc + func Timeout() echo.MiddlewareFunc + func TimeoutWithConfig(config TimeoutConfig) echo.MiddlewareFunc + func WWWRedirect() echo.MiddlewareFunc + func WWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc + type BasicAuthConfig struct + Realm string + Skipper Skipper + Validator BasicAuthValidator + type BasicAuthValidator func(string, string, echo.Context) (bool, error) + type BeforeFunc func(c echo.Context) + type BodyDumpConfig struct + Handler BodyDumpHandler + Skipper Skipper + type BodyDumpHandler func(echo.Context, []byte, []byte) + type BodyLimitConfig struct + Limit string + Skipper Skipper + type CORSConfig struct + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOriginFunc func(origin string) (bool, error) + AllowOrigins []string + ExposeHeaders []string + MaxAge int + Skipper Skipper + UnsafeWildcardOriginWithAllowCredentials bool + type CSRFConfig struct + ContextKey string + CookieDomain string + CookieHTTPOnly bool + CookieMaxAge int + CookieName string + CookiePath string + CookieSameSite http.SameSite + CookieSecure bool + ErrorHandler CSRFErrorHandler + Skipper Skipper + TokenLength uint8 + TokenLookup string + type CSRFErrorHandler func(err error, c echo.Context) error + type ContextTimeoutConfig struct + ErrorHandler func(err error, c echo.Context) error + Skipper Skipper + Timeout time.Duration + func (config ContextTimeoutConfig) ToMiddleware() (echo.MiddlewareFunc, error) + type DecompressConfig struct + GzipDecompressPool Decompressor + Skipper Skipper + type Decompressor interface + type DefaultGzipDecompressPool struct + type ErrKeyAuthMissing struct + Err error + func (e *ErrKeyAuthMissing) Error() string + func (e *ErrKeyAuthMissing) Unwrap() error + type Extractor func(context echo.Context) (string, error) + type GzipConfig struct + Level int + MinLength int + Skipper Skipper + type JWTConfig struct + AuthScheme string + BeforeFunc BeforeFunc + Claims jwt.Claims + ContextKey string + ContinueOnIgnoredError bool + ErrorHandler JWTErrorHandler + ErrorHandlerWithContext JWTErrorHandlerWithContext + KeyFunc jwt.Keyfunc + ParseTokenFunc func(auth string, c echo.Context) (interface{}, error) + SigningKey interface{} + SigningKeys map[string]interface{} + SigningMethod string + Skipper Skipper + SuccessHandler JWTSuccessHandler + TokenLookup string + TokenLookupFuncs []ValuesExtractor + type JWTErrorHandler func(err error) error + type JWTErrorHandlerWithContext func(err error, c echo.Context) error + type JWTSuccessHandler func(c echo.Context) + type KeyAuthConfig struct + AuthScheme string + ContinueOnIgnoredError bool + ErrorHandler KeyAuthErrorHandler + KeyLookup string + Skipper Skipper + Validator KeyAuthValidator + type KeyAuthErrorHandler func(err error, c echo.Context) error + type KeyAuthValidator func(auth string, c echo.Context) (bool, error) + type LogErrorFunc func(c echo.Context, err error, stack []byte) error + type LoggerConfig struct + CustomTagFunc func(c echo.Context, buf *bytes.Buffer) (int, error) + CustomTimeFormat string + Format string + Output io.Writer + Skipper Skipper + type MethodOverrideConfig struct + Getter MethodOverrideGetter + Skipper Skipper + type MethodOverrideGetter func(echo.Context) string + func MethodFromForm(param string) MethodOverrideGetter + func MethodFromHeader(header string) MethodOverrideGetter + func MethodFromQuery(param string) MethodOverrideGetter + type ProxyBalancer interface + AddTarget func(*ProxyTarget) bool + Next func(echo.Context) *ProxyTarget + RemoveTarget func(string) bool + func NewRandomBalancer(targets []*ProxyTarget) ProxyBalancer + func NewRoundRobinBalancer(targets []*ProxyTarget) ProxyBalancer + type ProxyConfig struct + Balancer ProxyBalancer + ContextKey string + ErrorHandler func(c echo.Context, err error) error + ModifyResponse func(*http.Response) error + RegexRewrite map[*regexp.Regexp]string + RetryCount int + RetryFilter func(c echo.Context, e error) bool + Rewrite map[string]string + Skipper Skipper + Transport http.RoundTripper + type ProxyTarget struct + Meta echo.Map + Name string + URL *url.URL + type RateLimiterConfig struct + BeforeFunc BeforeFunc + DenyHandler func(context echo.Context, identifier string, err error) error + ErrorHandler func(context echo.Context, err error) error + IdentifierExtractor Extractor + Skipper Skipper + Store RateLimiterStore + type RateLimiterMemoryStore struct + func NewRateLimiterMemoryStore(rate rate.Limit) (store *RateLimiterMemoryStore) + func NewRateLimiterMemoryStoreWithConfig(config RateLimiterMemoryStoreConfig) (store *RateLimiterMemoryStore) + func (store *RateLimiterMemoryStore) Allow(identifier string) (bool, error) + type RateLimiterMemoryStoreConfig struct + Burst int + ExpiresIn time.Duration + Rate rate.Limit + type RateLimiterStore interface + Allow func(identifier string) (bool, error) + type RecoverConfig struct + DisableErrorHandler bool + DisablePrintStack bool + DisableStackAll bool + LogErrorFunc LogErrorFunc + LogLevel log.Lvl + Skipper Skipper + StackSize int + type RedirectConfig struct + Code int + type RequestIDConfig struct + Generator func() string + RequestIDHandler func(echo.Context, string) + Skipper Skipper + TargetHeader string + type RequestLoggerConfig struct + BeforeNextFunc func(c echo.Context) + HandleError bool + LogContentLength bool + LogError bool + LogFormValues []string + LogHeaders []string + LogHost bool + LogLatency bool + LogMethod bool + LogProtocol bool + LogQueryParams []string + LogReferer bool + LogRemoteIP bool + LogRequestID bool + LogResponseSize bool + LogRoutePath bool + LogStatus bool + LogURI bool + LogURIPath bool + LogUserAgent bool + LogValuesFunc func(c echo.Context, v RequestLoggerValues) error + Skipper Skipper + func (config RequestLoggerConfig) ToMiddleware() (echo.MiddlewareFunc, error) + type RequestLoggerValues struct + ContentLength string + Error error + FormValues map[string][]string + Headers map[string][]string + Host string + Latency time.Duration + Method string + Protocol string + QueryParams map[string][]string + Referer string + RemoteIP string + RequestID string + ResponseSize int64 + RoutePath string + StartTime time.Time + Status int + URI string + URIPath string + UserAgent string + type RewriteConfig struct + RegexRules map[*regexp.Regexp]string + Rules map[string]string + Skipper Skipper + type SecureConfig struct + CSPReportOnly bool + ContentSecurityPolicy string + ContentTypeNosniff string + HSTSExcludeSubdomains bool + HSTSMaxAge int + HSTSPreloadEnabled bool + ReferrerPolicy string + Skipper Skipper + XFrameOptions string + XSSProtection string + type Skipper func(c echo.Context) bool + type StaticConfig struct + Browse bool + Filesystem http.FileSystem + HTML5 bool + IgnoreBase bool + Index string + Root string + Skipper Skipper + type TargetProvider interface + NextTarget func(echo.Context) (*ProxyTarget, error) + type TimeoutConfig struct + ErrorMessage string + OnTimeoutRouteErrorHandler func(err error, c echo.Context) + Skipper Skipper + Timeout time.Duration + func (config TimeoutConfig) ToMiddleware() (echo.MiddlewareFunc, error) + type TrailingSlashConfig struct + RedirectCode int + Skipper Skipper + type ValuesExtractor func(c echo.Context) ([]string, error) + func CreateExtractors(lookups string) ([]ValuesExtractor, error) + type Visitor struct Other modules containing this package github.com/Terencesun/echo/v3