Versions in this module Expand all Collapse all v0 v0.1.1 May 18, 2024 v0.1.0 Mar 12, 2024 Changes in this version + const EB + const GB + const GZIPEncoding + const KB + const MB + const PB + const StatusCodeContextCanceled + const TB + var DefaultCORSConfig = CORSConfig + var DefaultCSRFConfig = CSRFConfig + var DefaultKeyAuthConfig = KeyAuthConfig + var DefaultLoggerConfig = LoggerConfig + var DefaultMethodOverrideConfig = MethodOverrideConfig + var DefaultProxyConfig = ProxyConfig + var DefaultRateLimiterConfig = RateLimiterConfig + var DefaultRateLimiterMemoryStoreConfig = RateLimiterMemoryStoreConfig + var DefaultRecoverConfig = RecoverConfig + var DefaultSecureConfig = SecureConfig + var DefaultStaticConfig = StaticConfig + var ErrCSRFInvalid = echox.NewHTTPError(http.StatusForbidden, "invalid csrf token") + var ErrExtractorError = echox.NewHTTPError(http.StatusForbidden, "error while extracting identifier") + var ErrInvalidKey = echox.NewHTTPError(http.StatusUnauthorized, "invalid key") + var ErrKeyMissing = echox.NewHTTPError(http.StatusUnauthorized, "missing key") + var ErrRateLimitExceeded = echox.NewHTTPError(http.StatusTooManyRequests, "rate limit exceeded") + var RedirectHTTPSConfig = RedirectConfig + var RedirectHTTPSWWWConfig = RedirectConfig + var RedirectNonHTTPSWWWConfig = RedirectConfig + var RedirectNonWWWConfig = RedirectConfig + var RedirectWWWConfig = RedirectConfig + func AddTrailingSlash() echox.MiddlewareFunc + func AddTrailingSlashWithConfig(config AddTrailingSlashConfig) echox.MiddlewareFunc + func BasicAuth(fn BasicAuthValidator) echox.MiddlewareFunc + func BasicAuthWithConfig(config BasicAuthConfig) echox.MiddlewareFunc + func BodyDump(handler BodyDumpHandler) echox.MiddlewareFunc + func BodyDumpWithConfig(config BodyDumpConfig) echox.MiddlewareFunc + func BodyLimit(limitBytes int64) echox.MiddlewareFunc + func BodyLimitWithConfig(config BodyLimitConfig) echox.MiddlewareFunc + func CORS() echox.MiddlewareFunc + func CORSWithConfig(config CORSConfig) echox.MiddlewareFunc + func CSRF() echox.MiddlewareFunc + func CSRFWithConfig(config CSRFConfig) echox.MiddlewareFunc + func ContextTimeout(timeout time.Duration) echox.MiddlewareFunc + func ContextTimeoutWithConfig(config ContextTimeoutConfig) echox.MiddlewareFunc + func Decompress() echox.MiddlewareFunc + func DecompressWithConfig(config DecompressConfig) echox.MiddlewareFunc + func DefaultSkipper(echox.Context) bool + func Gzip() echox.MiddlewareFunc + func GzipWithConfig(config GzipConfig) echox.MiddlewareFunc + func HTTPSNonWWWRedirect() echox.MiddlewareFunc + func HTTPSNonWWWRedirectWithConfig(config RedirectConfig) echox.MiddlewareFunc + func HTTPSRedirect() echox.MiddlewareFunc + func HTTPSRedirectWithConfig(config RedirectConfig) echox.MiddlewareFunc + func HTTPSWWWRedirect() echox.MiddlewareFunc + func HTTPSWWWRedirectWithConfig(config RedirectConfig) echox.MiddlewareFunc + func KeyAuth(fn KeyAuthValidator) echox.MiddlewareFunc + func KeyAuthWithConfig(config KeyAuthConfig) echox.MiddlewareFunc + func Logger() echox.MiddlewareFunc + func LoggerWithConfig(config LoggerConfig) echox.MiddlewareFunc + func MethodOverride() echox.MiddlewareFunc + func MethodOverrideWithConfig(config MethodOverrideConfig) echox.MiddlewareFunc + func NonWWWRedirect() echox.MiddlewareFunc + func NonWWWRedirectWithConfig(config RedirectConfig) echox.MiddlewareFunc + func Proxy(balancer ProxyBalancer) echox.MiddlewareFunc + func ProxyWithConfig(config ProxyConfig) echox.MiddlewareFunc + func RateLimiter(store RateLimiterStore) echox.MiddlewareFunc + func RateLimiterWithConfig(config RateLimiterConfig) echox.MiddlewareFunc + func Recover() echox.MiddlewareFunc + func RecoverWithConfig(config RecoverConfig) echox.MiddlewareFunc + func RemoveTrailingSlash() echox.MiddlewareFunc + func RemoveTrailingSlashWithConfig(config RemoveTrailingSlashConfig) echox.MiddlewareFunc + func RequestID() echox.MiddlewareFunc + func RequestIDWithConfig(config RequestIDConfig) echox.MiddlewareFunc + func RequestLoggerWithConfig(config RequestLoggerConfig) echox.MiddlewareFunc + func Rewrite(rules map[string]string) echox.MiddlewareFunc + func RewriteWithConfig(config RewriteConfig) echox.MiddlewareFunc + func Secure() echox.MiddlewareFunc + func SecureWithConfig(config SecureConfig) echox.MiddlewareFunc + func Static(root string) echox.MiddlewareFunc + func StaticWithConfig(config StaticConfig) echox.MiddlewareFunc + func WWWRedirect() echox.MiddlewareFunc + func WWWRedirectWithConfig(config RedirectConfig) echox.MiddlewareFunc + type AddTrailingSlashConfig struct + RedirectCode int + Skipper Skipper + func (config AddTrailingSlashConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type BasicAuthConfig struct + Realm string + Skipper Skipper + Validator BasicAuthValidator + func (config BasicAuthConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type BasicAuthValidator func(c echox.Context, user string, password string) (bool, error) + type BeforeFunc func(c echox.Context) + type BodyDumpConfig struct + Handler BodyDumpHandler + Skipper Skipper + func (config BodyDumpConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type BodyDumpHandler func(c echox.Context, reqBody []byte, resBody []byte) + type BodyLimitConfig struct + LimitBytes int64 + Skipper Skipper + func (config BodyLimitConfig) ToMiddleware() (echox.MiddlewareFunc, error) + 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 + func (config CORSConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type CSRFConfig struct + ContextKey string + CookieDomain string + CookieHTTPOnly bool + CookieMaxAge int + CookieName string + CookiePath string + CookieSameSite http.SameSite + CookieSecure bool + ErrorHandler func(c echox.Context, err error) error + Generator func() string + Skipper Skipper + TokenLength uint8 + TokenLookup string + func (config CSRFConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type ContextTimeoutConfig struct + ErrorHandler func(c echox.Context, err error) error + Skipper Skipper + Timeout time.Duration + func (config ContextTimeoutConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type DecompressConfig struct + GzipDecompressPool Decompressor + Skipper Skipper + func (config DecompressConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type Decompressor interface + type DefaultGzipDecompressPool struct + type Extractor func(c echox.Context) (string, error) + type ExtractorSource string + const ExtractorSourceCookie + const ExtractorSourceForm + const ExtractorSourceHeader + const ExtractorSourcePathParam + const ExtractorSourceQuery + type GzipConfig struct + Level int + MinLength int + Skipper Skipper + func (config GzipConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type KeyAuthConfig struct + ContinueOnIgnoredError bool + ErrorHandler KeyAuthErrorHandler + KeyLookup string + Skipper Skipper + Validator KeyAuthValidator + func (config KeyAuthConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type KeyAuthErrorHandler func(c echox.Context, err error) error + type KeyAuthValidator func(c echox.Context, key string, source ExtractorSource) (bool, error) + type LoggerConfig struct + CustomTagFunc func(c echox.Context, buf *bytes.Buffer) (int, error) + CustomTimeFormat string + Format string + Output io.Writer + Skipper Skipper + func (config LoggerConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type MethodOverrideConfig struct + Getter MethodOverrideGetter + Skipper Skipper + func (config MethodOverrideConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type MethodOverrideGetter func(echox.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(echox.Context) (*ProxyTarget, error) + RemoveTarget func(string) bool + func NewRandomBalancer(targets []*ProxyTarget) ProxyBalancer + func NewRoundRobinBalancer(targets []*ProxyTarget) ProxyBalancer + type ProxyConfig struct + Balancer ProxyBalancer + ContextKey string + ErrorHandler func(c echox.Context, err error) error + ModifyResponse func(*http.Response) error + RegexRewrite map[*regexp.Regexp]string + RetryCount int + RetryFilter func(c echox.Context, e error) bool + Rewrite map[string]string + Skipper Skipper + Transport http.RoundTripper + func (config ProxyConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type ProxyTarget struct + Meta echox.Map + Name string + URL *url.URL + type RateLimiterConfig struct + BeforeFunc BeforeFunc + DenyHandler func(c echox.Context, identifier string, err error) error + ErrorHandler func(c echox.Context, err error) error + IdentifierExtractor Extractor + Skipper Skipper + Store RateLimiterStore + func (config RateLimiterConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type RateLimiterMemoryStore struct + func NewRateLimiterMemoryStore(rateLimit float64) (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 float64 + type RateLimiterStore interface + Allow func(identifier string) (bool, error) + type RecoverConfig struct + DisablePrintStack bool + DisableStackAll bool + Skipper Skipper + StackSize int + func (config RecoverConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type RedirectConfig struct + Code int + func (config RedirectConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type RemoveTrailingSlashConfig struct + RedirectCode int + Skipper Skipper + func (config RemoveTrailingSlashConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type RequestIDConfig struct + Generator func() string + RequestIDHandler func(c echox.Context, requestID string) + Skipper Skipper + TargetHeader string + func (config RequestIDConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type RequestLoggerConfig struct + BeforeNextFunc func(c echox.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 echox.Context, v RequestLoggerValues) error + Skipper Skipper + func (config RequestLoggerConfig) ToMiddleware() (echox.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 + func (config RewriteConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type SecureConfig struct + CSPReportOnly bool + ContentSecurityPolicy string + ContentTypeNosniff string + HSTSExcludeSubdomains bool + HSTSMaxAge int + HSTSPreloadEnabled bool + ReferrerPolicy string + Skipper Skipper + XFrameOptions string + XSSProtection string + func (config SecureConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type Skipper func(c echox.Context) bool + type StaticConfig struct + Browse bool + DirectoryListTemplate string + DisablePathUnescaping bool + Filesystem fs.FS + HTML5 bool + IgnoreBase bool + Index string + Root string + Skipper Skipper + func (config StaticConfig) ToMiddleware() (echox.MiddlewareFunc, error) + type ValueExtractorError struct + func (e *ValueExtractorError) Error() string + type ValuesExtractor func(c echox.Context) ([]string, ExtractorSource, error) + func CreateExtractors(lookups string) ([]ValuesExtractor, error) + type Visitor struct