Documentation
¶
Index ¶
- type BasicAuth
- type BasicAuthAuthorizer
- type BasicAuthBadRequest
- type BasicAuthConfig
- type BasicAuthNext
- type BasicAuthUnauthorized
- type Cache
- type CacheConfig
- type CacheExpirationGenerator
- type CacheInvalidator
- type CacheKeyGenerator
- type CacheNext
- type Compress
- type CompressConfig
- type CompressNext
- type Cors
- type CorsAllowOriginsFunc
- type CorsConfig
- type CorsNext
- type Csrf
- type CsrfConfig
- type CsrfErrorHandler
- type CsrfExtractor
- type CsrfKeyGenerator
- type CsrfNext
- type CsrfSecurityConfig
- type EarlyData
- type EarlyDataAllowEarlyData
- type EarlyDataConfig
- type EarlyDataError
- type EarlyDataIsEarlyData
- type EarlyDataNext
- type EncryptCookie
- type EncryptCookieConfig
- type EncryptCookieDecryptor
- type EncryptCookieEncryptor
- type EncryptCookieNext
- type EnvVar
- type EnvVarConfig
- type Etag
- type EtagConfig
- type EtagNext
- type ExpVar
- type ExpVarConfig
- type ExpVarNext
- type Favicon
- type FaviconConfig
- type FaviconFileSystem
- type FaviconNext
- type HealthCheck
- type HealthCheckConfig
- type HealthCheckNext
- type HealthCheckProbe
- type HealthCheckResponseFormat
- type Helmet
- type HelmetConfig
- type HelmetNext
- type HostAuthorization
- type HostAuthorizationAllowedHostsFunc
- type HostAuthorizationConfig
- type HostAuthorizationErrorHandler
- type HostAuthorizationNext
- type Idempotency
- type IdempotencyConfig
- type IdempotencyKeyHeaderValidate
- type IdempotencyLocker
- type IdempotencyNext
- type KeyAuth
- type KeyAuthConfig
- type KeyAuthErrorHandler
- type KeyAuthExtractor
- type KeyAuthNext
- type KeyAuthSuccessHandler
- type KeyAuthValidator
- type Limiter
- type LimiterConfig
- type LimiterKeyGenerator
- type LimiterLimitReached
- type LimiterMaxFunc
- type LimiterNext
- type Logger
- type LoggerBeforeHandlerFunc
- type LoggerConfig
- type LoggerCustomTags
- type LoggerDone
- type LoggerLoggerFunc
- type LoggerNext
- type LoggerSkip
- type Paginate
- type PaginateConfig
- type PaginateNext
- type Pprof
- type PprofConfig
- type PprofNext
- type Recover
- type RecoverConfig
- type RecoverNext
- type RecoverPanicHandler
- type RecoverStackTraceHandler
- type Redirect
- type RedirectConfig
- type RedirectNext
- type RequestID
- type RequestIDConfig
- type RequestIDGenerator
- type RequestIDNext
- type Rewrite
- type RewriteConfig
- type RewriteNext
- type Session
- type SessionConfig
- type SessionErrorHandler
- type SessionExtractor
- type SessionKeyGenerator
- type SessionNext
- type SessionSecurityConfig
- type SessionStore
- type Static
- type StaticConfig
- type StaticFS
- type StaticModifyResponse
- type StaticNext
- type StaticNotFoundHandler
- type Timeout
- type TimeoutConfig
- type TimeoutErrors
- type TimeoutNext
- type TimeoutOnTimeout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuth ¶
type BasicAuth struct {
PreAuthenticationFilter
// contains filtered or unexported fields
}
BasicAuth is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
NOTE: This middleware is marked with the github.com/BeamFoundry/rays/pkg/core.PreAuthenticationFilter interface. As such it will be skipped when used with github.com/BeamFoundry/rays-web-security.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
BasicAuth
}
func (this *ApiController) BasicAuthConfig(config *basicauth.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are BasicAuthNext, BasicAuthAuthorizer, BasicAuthUnauthorized and BasicAuthBadRequest.
Also, the parent container may implements BasicAuthConfig to receive a pointer to the basicauth.Config that will be used.
Please see those interface definitions and the basicauth middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: basicauth: users: # dictionary of username/password admin: null # Note: null passworded users will be ignored. charset: "UTF-8" realm: "Restricted" headerLimit: 8192
func (*BasicAuth) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*BasicAuth) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type BasicAuthAuthorizer ¶
BasicAuthAuthorizer is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses BasicAuth, to indicates a function to check the credentials. It will be called with a username, password, and the current context and is expected to return true or false to indicate approval.
Please see the basicauth middleware configuration documentation.
type BasicAuthBadRequest ¶
BasicAuthBadRequest is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses BasicAuth, to indicates a fiber.Handler to generate a response for malformed Authorization headers.
Please see the basicauth middleware configuration documentation.
type BasicAuthConfig ¶
BasicAuthConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses BasicAuth, to review the basicauth.Config that will be configured by BasicAuth
Please see the basicauth middleware configuration documentation.
type BasicAuthNext ¶
BasicAuthNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses BasicAuth, to indicates when to skip it this middleware.
Please see the basicauth middleware configuration documentation.
type BasicAuthUnauthorized ¶
type BasicAuthUnauthorized interface {
}
BasicAuthUnauthorized is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses BasicAuth, to indicates a fiber.Handler to generate a response body for unauthorized requests.
Please see the basicauth middleware configuration documentation.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Cache
}
func (this *ApiController) CacheConfig(config *cache.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are CacheNext, CacheInvalidator, CacheKeyGenerator and CacheExpirationGenerator.
Also, the parent container may implements CacheConfig to receive a pointer to the cache.Config that will be used.
Please see those interface definitions and the cache middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
cache:
expiration: 5m
cacheHeader: "X-Cache"
disablelCacheControl: false
disableQueryKeys: false
disableValueRedaction: false
disableVaryHeaders: false
keyHeaders: ["accept", "accept-encoding", "accept-language"]
keyCookies: []
storage: null
storeResponseHeaders: false
maxBytes: 0
methods: [ "GET", "HEAD" ]
func (*Cache) PostConstruct ¶
type CacheConfig ¶
CacheConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cache, to review the cache.Config that will be configured by Cache
Please see the cache middleware configuration documentation.
type CacheExpirationGenerator ¶
type CacheExpirationGenerator interface {
CacheExpirationGenerator() func(fiber.Ctx, *cache.Config) time.Duration
}
CacheExpirationGenerator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cache, to generate custom expiration keys based on the request.
Please see the cache middleware configuration documentation.
type CacheInvalidator ¶
CacheInvalidator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cache, to indicates a function that is executed before checking the cache entry. It can be used to invalidate the existing cache manually by returning true.
Please see the cache middleware configuration documentation.
type CacheKeyGenerator ¶
CacheKeyGenerator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cache, to generate custom keys. The HTTP method and a key-format version are partitioned internally by the middleware.
Please see the cache middleware configuration documentation.
type CacheNext ¶
CacheNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cache, to indicates when to skip the creation of a new cache entry. If an entry already exists, it will be used.
Please see the cache middleware configuration documentation.
type Compress ¶
type Compress struct {
// contains filtered or unexported fields
}
Compress is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Compress
}
func (this *ApiController) CompressConfig(config *compress.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are CompressNext. Alternatively, the parent container may implements CompressConfig to receive a pointer to the compress.Config that will be used.
Please see those interface definitions and the compress middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: compress: level: "default" # Case Unsensitive. Possible values : Default, Disabled, Speed, BestSpeed, Compression, BestCompression.
func (*Compress) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Compress) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type CompressConfig ¶
CompressConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Compress, to review the compress.Config that will be configured by Compress
Please see the compress middleware configuration documentation.
type CompressNext ¶
CompressNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Compress, to indicates when to skip it this middleware.
Please see the compress middleware configuration documentation.
type Cors ¶
type Cors struct {
// contains filtered or unexported fields
}
Cors is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Cors
}
func (this *ApiController) CorsConfig(config *cors.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are CorsNext, and CorsAllowOriginsFunc.
Also, the parent container may implements CorsConfig to receive a pointer to the cors.Config that will be used.
Please see those interface definitions and the cors middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: cors: allowOrigins: ["*"] allowMethods: ["GET", "POST", "HEAD", "PUT", "DELETE", "PATCH"] allowHeaders: [] allowCredentials: false allowPrivateNetwork: false disableValueRedaction: false exposeHeaders: [] maxAge: 0
func (*Cors) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Cors) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type CorsAllowOriginsFunc ¶
CorsAllowOriginsFunc is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cors, to indicates a function that dynamically determines whether to allow a request based on its origin.
Please see the cors middleware configuration documentation.
type CorsConfig ¶
CorsConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cors, to review the cors.Config that will be configured by Cors
Please see the cors middleware configuration documentation.
type CorsNext ¶
CorsNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Cors, to indicates when to skip it this middleware.
Please see the cors middleware configuration documentation.
type Csrf ¶
type Csrf struct {
PostAuthorisationFilter
// contains filtered or unexported fields
}
Csrf is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
NOTE: This middleware is marked with the github.com/BeamFoundry/rays/pkg/core.PostAuthorisationFilter interface. As such it will be skipped when used with github.com/BeamFoundry/rays-web-security but it will be configured and used automatically, if needed.
WARNING: This middleware may depends on the Session middleware. As such the Session middleware MUST always be configured before Csrf. Please see the example below, the session and csrf Fiber documentation.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Session // Session should always be initialized before Csrf.
Csrf
}
func (this *ApiController) CsrfConfig(config *csrf.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are CsrfNext, CsrfExtractor, CsrfKeyGenerator and CsrfErrorHandler.
Also, the parent container may implements CsrfConfig to receive a pointer to the csrf.Config that will be used.
Please see those interface definitions and the csrf middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: csrf: cookieName: "csrf_" cookieDomain: "" cookiePath: "" cookieSameSite: "Lax" trustedOrigins: [] idleTimeout: 30m cookieSecure: false cookieHTTPOnly: false cookieSessionOnly: false disableValueRedaction: false singleUseToken: false
func (*Csrf) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Csrf) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type CsrfConfig ¶
CsrfConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Csrf, to review the csrf.Config that will be configured by Csrf
Please see the csrf middleware configuration documentation.
type CsrfErrorHandler ¶
CsrfErrorHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Csrf, to indicates when to skip it this middleware.
Please see the csrf middleware configuration documentation.
type CsrfExtractor ¶
type CsrfExtractor interface {
CsrfExtractor() extractors.Extractor
}
CsrfExtractor is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Csrf, to indicates a token extraction method.
Please see the csrf middleware configuration documentation.
type CsrfKeyGenerator ¶
type CsrfKeyGenerator interface {
CsrfKeyGenerator() func() string
}
CsrfKeyGenerator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Csrf, to indicates a token generation function.
Please see the csrf middleware configuration documentation.
type CsrfNext ¶
CsrfNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Csrf, to indicates when to skip it this middleware.
Please see the csrf middleware configuration documentation.
type CsrfSecurityConfig ¶
CsrfSecurityConfig is an interface to be defined by a component that will customize the Csrf middleware when an HttpSecurity is defined for that server instance.
Please see the csrf middleware configuration documentation.
type EarlyData ¶
type EarlyData struct {
// contains filtered or unexported fields
}
EarlyData is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
EarlyData
}
func (this *ApiController) EarlyDataConfig(config *earlydata.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are EarlyDataNext, EarlyDataIsEarlyData, EarlyDataAllowEarlyData and EarlyDataError.
Also, the parent container may implements EarlyDataConfig to receive a pointer to the earlydata.Config that will be used.
Please see those interface definitions and the earlydata middleware documentation.
func (*EarlyData) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*EarlyData) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type EarlyDataAllowEarlyData ¶
EarlyDataAllowEarlyData is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EarlyData, to indicates if an early-data request should be allowed.
Please see the earlydata middleware configuration documentation.
type EarlyDataConfig ¶
EarlyDataConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EarlyData, to review the earlydata.Config that will be configured by EarlyData
Please see the earlydata middleware configuration documentation.
type EarlyDataError ¶
type EarlyDataError interface {
EarlyDataError() error
}
EarlyDataError is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EarlyData, to indicates which error to return when an early-data request is rejected. Defaults to fiber.ErrTooEarly.
Please see the earlydata middleware configuration documentation.
type EarlyDataIsEarlyData ¶
EarlyDataIsEarlyData is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EarlyData, to indicates whether the request used early data.
Please see the earlydata middleware configuration documentation.
type EarlyDataNext ¶
EarlyDataNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EarlyData, to indicates when to skip it this middleware.
Please see the earlydata middleware configuration documentation.
type EncryptCookie ¶
type EncryptCookie struct {
// contains filtered or unexported fields
}
EncryptCookie is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
EncryptCookie
}
func (this *ApiController) EncryptCookieConfig(config *encryptcookie.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are EncryptCookieNext, EncryptCookieEncryptor and EncryptCookieDecryptor.
Also, the parent container may implements EncryptCookieConfig to receive a pointer to the encryptcookie.Config that will be used.
Please see those interface definitions and the encryptcookie middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: encryptcookie: key: null except: []
func (*EncryptCookie) Handler ¶
func (this *EncryptCookie) Handler() fiber.Handler
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*EncryptCookie) PostConstruct ¶
func (this *EncryptCookie) PostConstruct(parent any) Error
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type EncryptCookieConfig ¶
type EncryptCookieConfig interface {
EncryptCookieConfig(config *encryptcookie.Config)
}
EncryptCookieConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EncryptCookie, to review the encryptcookie.Config that will be configured by EncryptCookie
Please see the encryptcookie middleware configuration documentation.
type EncryptCookieDecryptor ¶
type EncryptCookieDecryptor interface {
EncryptCookieDecryptor() func(name, encryptedString, key string) (string, error)
}
EncryptCookieNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EncryptCookie, to indicates a custom function to decrypt cookies.
Please see the encryptcookie middleware configuration documentation.
type EncryptCookieEncryptor ¶
type EncryptCookieEncryptor interface {
EncryptCookieEncryptor() func(name, decryptedString, key string) (string, error)
}
EncryptCookieNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EncryptCookie, to indicates a custom function to encrypt cookies.
Please see the encryptcookie middleware configuration documentation.
type EncryptCookieNext ¶
EncryptCookieNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EncryptCookie, to indicates when to skip it this middleware.
Please see the encryptcookie middleware configuration documentation.
type EnvVar ¶
type EnvVar struct {
// contains filtered or unexported fields
}
EnvVar is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
EnvVar
}
func (this *ApiController) EnvVarConfig(config *envvar.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties.
Also, the parent container may implements EnvVarConfig to receive a pointer to the envvar.Config that will be used.
Please see those interface definitions and the envvar middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
envvar:
exportVars: {"HOME":null} # Using null as a map value will not register it. Use "" to have an empty value
func (*EnvVar) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*EnvVar) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type EnvVarConfig ¶
EnvVarConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses EnvVar, to review the envvar.Config that will be configured by EnvVar
Please see the envvar middleware configuration documentation.
type Etag ¶
type Etag struct {
// contains filtered or unexported fields
}
Etag is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Etag
}
func (this *ApiController) EtagConfig(config *etag.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. The only interface is EtagNext.
Also, the parent container may implements EtagConfig to receive a pointer to the etag.Config that will be used.
Please see those interface definitions and the etag middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: etag: weak: false
func (*Etag) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Etag) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type EtagConfig ¶
EtagConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Etag, to review the etag.Config that will be configured by Etag
Please see the etag middleware configuration documentation.
type EtagNext ¶
EtagNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Etag, to indicates when to skip it this middleware.
Please see the etag middleware configuration documentation.
type ExpVar ¶
type ExpVar struct {
// contains filtered or unexported fields
}
ExpVar is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
ExpVar
}
func (this *ApiController) ExpVarConfig(config *expvar.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through the interface ExpVarNext the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements.
Also, the parent container may implements ExpVarConfig to receive a pointer to the expvar.Config that will be used.
Please see those interface definitions and the expvar middleware documentation.
func (*ExpVar) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*ExpVar) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type ExpVarConfig ¶
ExpVarConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses ExpVar, to review the expvar.Config that will be configured by ExpVar
Please see the expvar middleware configuration documentation.
type ExpVarNext ¶
ExpVarNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses ExpVar, to indicates when to skip it this middleware.
Please see the expvar middleware configuration documentation.
type Favicon ¶
type Favicon struct {
// contains filtered or unexported fields
}
Favicon is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Favicon
}
func (this *ApiController) FaviconConfig(config *favicon.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are FaviconNext and FaviconFileSystem.
Also, the parent container may implements FaviconConfig to receive a pointer to the favicon.Config that will be used.
Please see those interface definitions and the favicon middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: favicon: file: "" url: "/favicon.ico" cacheControl: "public, max-age=31536000"
func (*Favicon) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Favicon) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type FaviconConfig ¶
FaviconConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Favicon, to review the favicon.Config that will be configured by Favicon
Please see the favicon middleware configuration documentation.
type FaviconFileSystem ¶
FaviconFileSystem is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Favicon, to indicates an optional alternate filesystem from which to load the favicon file.
Please see the favicon middleware configuration documentation.
type FaviconNext ¶
FaviconNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Favicon, to indicates when to skip it this middleware.
Please see the favicon middleware configuration documentation.
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
HealthCheck
}
func (this *ApiController) HealthCheckConfig(config *healthcheck.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are HealthCheckNext and HealthCheckProbe.
Also, the parent container may implements HealthCheckConfig to receive a pointer to the healthcheck.Config that will be used.
Please see those interface definitions and the healthcheck middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: healthcheck: format: "TEXT" # Possible values : TEXT, JSON, XML, MSGPACK, CBOR
func (*HealthCheck) Handler ¶
func (this *HealthCheck) Handler() fiber.Handler
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*HealthCheck) PostConstruct ¶
func (this *HealthCheck) PostConstruct(parent any) Error
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type HealthCheckConfig ¶
type HealthCheckConfig interface {
HealthCheckConfig(config *healthcheck.Config)
}
HealthCheckConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HealthCheck, to review the healthcheck.Config that will be configured by HealthCheck
Please see the healthcheck middleware configuration documentation.
type HealthCheckNext ¶
HealthCheckNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HealthCheck, to indicates when to skip it this middleware.
Please see the healthcheck middleware configuration documentation.
type HealthCheckProbe ¶
HealthCheckProbe is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HealthCheck, to indicates a function that will be used to check probe the health.
Please see the healthcheck middleware configuration documentation.
type HealthCheckResponseFormat ¶
type HealthCheckResponseFormat struct {
Enum[HealthCheckResponseFormat]
TEXT,
JSON,
XML,
MSGPACK,
CBOR Enum[HealthCheckResponseFormat]
}
HealthCheckResponseFormat is an Enum type to convert format to use from a string. Please see the healthcheck middleware configuration documentation.
type Helmet ¶
type Helmet struct {
// contains filtered or unexported fields
}
Helmet is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Helmet
}
func (this *ApiController) HelmetConfig(config *helmet.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through the interface HelmetNext the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements.
Also, the parent container may implements HelmetConfig to receive a pointer to the helmet.Config that will be used.
Please see those interface definitions and the helmet middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: helmet: xSSProtection: "0" contentTypeNosniff: "nosniff" xFrameOptions: "SAMEORIGIN" contentSecurityPolicy: "" referrerPolicy: "no-referrer" permissionPolicy: "" crossOriginEmbedderPolicy: "require-corp" crossOriginOpenerPolicy: "same-origin" crossOriginResourcePolicy: "same-origin" originAgentCluster: "?1" xDNSPrefetchControl: "off" xDownloadOptions: "noopen" xPermittedCrossDomain: "none" hstsMaxAge: 0 hstsExcludeSubdomains: false cspReportOnly: false hstsPreloadEnabled: false
func (*Helmet) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type HelmetConfig ¶
HelmetConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Helmet, to review the helmet.Config that will be configured by Helmet
Please see the helmet middleware configuration documentation.
type HelmetNext ¶
HelmetNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Helmet, to indicates when to skip it this middleware.
Please see the helmet middleware configuration documentation.
type HostAuthorization ¶
type HostAuthorization struct {
// contains filtered or unexported fields
}
HostAuthorization is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
HostAuthorization
}
func (this *ApiController) HostAuthorizationConfig(config *hostauthorization.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are HostAuthorizationNext, [], [] and [].
Also, the parent container may implements HostAuthorizationConfig to receive a pointer to the hostauthorization.Config that will be used.
Please see those interface definitions and the hostauthorization middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
hostauthorization:
allowedHosts: []
func (*HostAuthorization) Handler ¶
func (this *HostAuthorization) Handler() fiber.Handler
func (*HostAuthorization) PostConstruct ¶
func (this *HostAuthorization) PostConstruct(parent any) Error
type HostAuthorizationAllowedHostsFunc ¶
type HostAuthorizationAllowedHostsFunc interface {
HostAuthorizationAllowedHostsFunc() func(host string) bool
}
HostAuthorizationAllowedHostsFunc is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HostAuthorization, to indicates dynamic validator called only when no static AllowedHosts rule matches.
Please see the hostauthorization middleware configuration documentation.
type HostAuthorizationConfig ¶
type HostAuthorizationConfig interface {
HostAuthorizationConfig(config *hostauthorization.Config)
}
HostAuthorizationConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HostAuthorization, to review the hostauthorization.Config that will be configured by hostauthorization
Please see the hostauthorization middleware configuration documentation.
type HostAuthorizationErrorHandler ¶
type HostAuthorizationErrorHandler interface {
HostAuthorizationErrorHandler() fiber.ErrorHandler
}
HostAuthorizationNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HostAuthorization, to indicates an error handler called when a request is rejected.
Please see the hostauthorization middleware configuration documentation.
type HostAuthorizationNext ¶
HostAuthorizationNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses HostAuthorization, to indicates when to skip it this middleware.
Please see the hostauthorization middleware configuration documentation.
type Idempotency ¶
type Idempotency struct {
// contains filtered or unexported fields
}
Idempotency is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Idempotency
}
func (this *ApiController) IdempotencyConfig(config *idempotency.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are IdempotencyNext, IdempotencyKeyHeaderValidate and IdempotencyLocker.
Also, the parent container may implements IdempotencyConfig to receive a pointer to the idempotency.Config that will be used.
Please see those interface definitions and the idempotency middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: idempotency: lifetime: 30m keyHeader: "X-Idempotency-Key" keepResponseHeaders: [] storage: null
func (*Idempotency) Handler ¶
func (this *Idempotency) Handler() fiber.Handler
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Idempotency) PostConstruct ¶
func (this *Idempotency) PostConstruct(parent any) Error
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type IdempotencyConfig ¶
type IdempotencyConfig interface {
IdempotencyConfig(config *idempotency.Config)
}
IdempotencyConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Idempotency, to review the idempotency.Config that will be configured by Idempotency
Please see the idempotency middleware configuration documentation.
type IdempotencyKeyHeaderValidate ¶
IdempotencyKeyHeaderValidate is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Idempotency, to indicates a function to validate idempotency header syntax.
Please see the idempotency middleware configuration documentation.
type IdempotencyLocker ¶
type IdempotencyLocker interface {
IdempotencyLocker() idempotency.Locker
}
IdempotencyLocker is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Idempotency, to indicates a lock to prevent race conditions..
Please see the idempotency middleware configuration documentation.
type IdempotencyNext ¶
IdempotencyNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Idempotency, to indicates when to skip it this middleware.
Please see the idempotency middleware configuration documentation.
type KeyAuth ¶
type KeyAuth struct {
PreAuthenticationFilter
// contains filtered or unexported fields
}
KeyAuth is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
NOTE: This middleware is marked with the github.com/BeamFoundry/rays/pkg/core.PreAuthenticationFilter interface. As such it will be skipped when used with github.com/BeamFoundry/rays-web-security.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
KeyAuth
}
func (this *ApiController) KeyAuthConfig(config *keyauth.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are KeyAuthNext, KeyAuthSuccessHandler, KeyAuthErrorHandler and KeyAuthValidator.
Also, the parent container may implements KeyAuthConfig to receive a pointer to the keyauth.Config that will be used.
Please see those interface definitions and the keyauth middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: keyauth: realm: Restricted challenge: ApiKey realm="Restricted" errorCode: "" # Allowed values are `invalid_request`, `invalid_token`, or `insufficient_scope`. errorDescription: "" errorURI: "" scope: ""
func (*KeyAuth) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*KeyAuth) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type KeyAuthConfig ¶
KeyAuthConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to review the keyauth.Config that will be configured by KeyAuth
Please see the keyauth middleware configuration documentation.
type KeyAuthErrorHandler ¶
type KeyAuthErrorHandler interface {
KeyAuthErrorHandler() fiber.ErrorHandler
}
KeyAuthErrorHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to indicates a function which is executed for an invalid key. By default a 401 response with a WWW-Authenticate challenge is sent.
Please see the keyauth middleware configuration documentation.
type KeyAuthExtractor ¶
type KeyAuthExtractor interface {
KeyAuthExtractor() extractors.Extractor
}
KeyAuthExtractor is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to indicates how to retrieve the key from the request.
Please see the keyauth middleware configuration documentation.
type KeyAuthNext ¶
KeyAuthNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to indicates when to skip it this middleware.
Please see the keyauth middleware configuration documentation.
type KeyAuthSuccessHandler ¶
KeyAuthSuccessHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to indicates a function which is executed for a valid key.
Please see the keyauth middleware configuration documentation.
type KeyAuthValidator ¶
KeyAuthValidator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses KeyAuth, to indicates a function to validate the key.
Please see the keyauth middleware configuration documentation.
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Limiter
}
func (this *ApiController) LimiterConfig(config *limiter.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are LimiterNext, LimiterMaxFunc, LimiterKeyGenerator and LimiterLimitReached.
Also, the parent container may implements [limiterConfig] to receive a pointer to the limiter.Config that will be used.
Please see those interface definitions and the limiter middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: limiter: handler: fixed maxConn: 5 # Renamed from max expiration: 1m skipFailedRequests: false skipSuccessfulRequests: false
func (*Limiter) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Limiter) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type LimiterConfig ¶
LimiterConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Limiter, to review the limiter.Config that will be configured by Limiter
Please see the limiter middleware configuration documentation.
type LimiterKeyGenerator ¶
LimiterKeyGenerator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Limiter, to indicates a function to generate custom keys; uses Ctx.IP() by default.
Please see the limiter middleware configuration documentation.
type LimiterLimitReached ¶
LimiterLimitReached is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Limiter, to indicates a function called when a request exceeds the limit.
Please see the limiter middleware configuration documentation.
type LimiterMaxFunc ¶
LimiterMaxFunc is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Limiter, to indicates a function that calculates the maximum number of recent connections within Expiration seconds before sending a 429 response.
Please see the limiter middleware configuration documentation.
type LimiterNext ¶
LimiterNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Limiter, to indicates when to skip it this middleware.
Please see the limiter middleware configuration documentation.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Logger
}
func (this *ApiController) FiberLoggerConfig(config *logger.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are LoggerNext, LoggerSkip, LoggerDone, LoggerCustomTags, LoggerBeforeHandlerFunc and LoggerLoggerFunc.
Also, the parent container may implements LoggerConfig to receive a pointer to the logger.Config that will be used.
Please see those interface definitions and the logger middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: logger: format: DefaultFormat timeFormat: 15:04:05 timeZone: Local timeInterval: 500ms disableColors: false forceColors: false
func (*Logger) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Logger) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type LoggerBeforeHandlerFunc ¶
LoggerBeforeHandlerFunc is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates a BeforeHandlerFunc runs once before the handler is built, letting you customize colors, template, etc.
Please see the logger middleware configuration documentation.
type LoggerConfig ¶
LoggerConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to review the logger.Config that will be configured by Logger
Please see the logger middleware configuration documentation.
type LoggerCustomTags ¶
LoggerCustomTags is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates a custom tag actions for this logger instance. These tags override built-in and globally registered tags with the same name.
Please see the logger middleware configuration documentation.
type LoggerDone ¶
LoggerDone is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates a function that is called after the log string for a request is written to Stream, and pass the log string as parameter.
Please see the logger middleware configuration documentation.
type LoggerLoggerFunc ¶
type LoggerLoggerFunc interface {
LoggerLoggerFunc() func(c fiber.Ctx, data *logger.Data, cfg *logger.Config) error
}
LoggerLoggerFunc is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates a custom logger function for integration with logging libraries (Zerolog, Zap, Logrus, etc). Defaults to Fiber's default logger if not defined.
Please see the logger middleware configuration documentation.
type LoggerNext ¶
LoggerNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates when to skip it this middleware.
Please see the logger middleware configuration documentation.
type LoggerSkip ¶
LoggerSkip is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Logger, to indicates a function to determine if logging is skipped or written to Stream.
Please see the logger middleware configuration documentation.
type Paginate ¶
type Paginate struct {
// contains filtered or unexported fields
}
Paginate is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Paginate
}
func (this *ApiController) PaginateConfig(config *paginate.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are PaginateNext, [], [] and [].
Also, the parent container may implements PaginateConfig to receive a pointer to the paginate.Config that will be used.
Please see those interface definitions and the paginate middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
paginate:
expiration: 5m
func (*Paginate) PostConstruct ¶
type PaginateConfig ¶
PaginateConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Paginate, to review the paginate.Config that will be configured by paginate
Please see the paginate middleware configuration documentation.
type PaginateNext ¶
PaginateNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Paginate, to indicates when to skip it this middleware.
Please see the paginate middleware configuration documentation.
type Pprof ¶
type Pprof struct {
// contains filtered or unexported fields
}
Pprof is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Pprof
}
func (this *ApiController) PprofConfig(config *pprof.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through the interface PprofNext the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements.
Also, the parent container may implements PprofConfig to receive a pointer to the pprof.Config that will be used.
Please see those interface definitions and the pprof middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: pprof: prefix: ""
func (*Pprof) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Pprof) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type PprofConfig ¶
PprofConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Pprof, to review the pprof.Config that will be configured by Pprof
Please see the pprof middleware configuration documentation.
type PprofNext ¶
PprofNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Pprof, to indicates when to skip it this middleware.
Please see the pprof middleware configuration documentation.
type Recover ¶
type Recover struct {
// contains filtered or unexported fields
}
Recover is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Recover
}
func (this *ApiController) RecoverConfig(config *recover.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are RecoverNext RecoverPanicHandler and RecoverStackTraceHandler.
Also, the parent container may implements [recoverConfig] to receive a pointer to the recover.Config that will be used.
Please see those interface definitions and the recover middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: recover: enableStackTrace: false
func (*Recover) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Recover) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type RecoverConfig ¶
RecoverConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Recover, to review the recover.Config that will be configured by Recover
Please see the recover middleware configuration documentation.
type RecoverNext ¶
RecoverNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Recover, to indicates when to skip it this middleware.
Please see the recover middleware configuration documentation.
type RecoverPanicHandler ¶
RecoverPanicHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Recover, to indicates a customize the error returned from a recovered panic.
Please see the recover middleware configuration documentation.
type RecoverStackTraceHandler ¶
RecoverStackTraceHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Recover, to indicates how to handle the captured stack trace when enabled.
Please see the recover middleware configuration documentation.
type Redirect ¶
type Redirect struct {
// contains filtered or unexported fields
}
Redirect is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Redirect
}
func (this *ApiController) RedirectConfig(config *redirect.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through the RedirectNext interface the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements.
Also, the parent container may implements RedirectConfig to receive a pointer to the redirect.Config that will be used.
Please see those interface definitions and the redirect middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: redirect: rules: /api/*: null # null values will be ignored. statusCode: 302
func (*Redirect) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Redirect) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type RedirectConfig ¶
RedirectConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Redirect, to review the redirect.Config that will be configured by Redirect
Please see the redirect middleware configuration documentation.
type RedirectNext ¶
RedirectNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Redirect, to indicates when to skip it this middleware.
Please see the redirect middleware configuration documentation.
type RequestID ¶
type RequestID struct {
// contains filtered or unexported fields
}
RequestID is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
RequestID
}
func (this *ApiController) RequestIDConfig(config *requestid.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are RequestIDNext and RequestIDGenerator.
Also, the parent container may implements RequestIDConfig to receive a pointer to the requestid.Config that will be used.
Please see those interface definitions and the requestid middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: requestid: header: "X-Request-ID"
func (*RequestID) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*RequestID) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type RequestIDConfig ¶
RequestIDConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses RequestID, to review the requestid.Config that will be configured by RequestID
Please see the requestid middleware configuration documentation.
type RequestIDGenerator ¶
type RequestIDGenerator interface {
RequestIDGenerator() func() string
}
RequestIDNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses RequestID, to indicates when to skip it this middleware.
Please see the requestid middleware configuration documentation.
type RequestIDNext ¶
RequestIDNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses RequestID, to indicates when to skip it this middleware.
Please see the requestid middleware configuration documentation.
type Rewrite ¶
type Rewrite struct {
// contains filtered or unexported fields
}
Rewrite is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Rewrite
}
func (this *ApiController) RewriteConfig(config *rewrite.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through the RewriteNext interface the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements.
Also, the parent container may implements RewriteConfig to receive a pointer to the rewrite.Config that will be used.
Please see those interface definitions and the rewrite middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
rewrite:
rules:
/api/*: null # null values will be ignored.
func (*Rewrite) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Rewrite) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type RewriteConfig ¶
RewriteConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Rewrite, to review the rewrite.Config that will be configured by Rewrite
Please see the rewrite middleware configuration documentation.
type RewriteNext ¶
RewriteNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Rewrite, to indicates when to skip it this middleware.
Please see the rewrite middleware configuration documentation.
type Session ¶
type Session struct {
PostAuthorisationFilter
// contains filtered or unexported fields
}
Session is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
NOTE: This middleware is marked with the github.com/BeamFoundry/rays/pkg/core.PostAuthorisationFilter interface. As such it will be skipped when used with github.com/BeamFoundry/rays-web-security but it will be configured and used automatically, if needed.
WARNING: The Csrf middleware may on thiss middleware. As such the Session middleware MUST always be configured before Csrf. Please see the example below, the session and csrf Fiber documentation.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Session
Csrf
}
func (this *ApiController) SessionConfig(config *session.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are SessionNext, SessionErrorHandler, SessionKeyGenerator and SessionExtractor.
Also, the parent container may implements SessionConfig to receive a pointer to the session.Config that will be used.
Please see those interface definitions and the session middleware documentation.
Properties mapping : ¶
rays:
fiber:
servers:
primary:
session:
storage: null
cookieDomain: ""
cookiePath: ""
cookieSameSite: "Lax"
idleTimeout: 30m
absoluteTimeout: 0s
cookieSecure: false
cookieHTTPOnly: false
cookieSessionOnly: false
func (*Session) Handler ¶
Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler
func (*Session) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
func (*Session) SessionStore ¶
SessionStore() implements SessionStore.
type SessionConfig ¶
SessionConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Session, to review the session.Config that will be configured by Session
Please see the session middleware configuration documentation.
type SessionErrorHandler ¶
SessionErrorHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Session, to indicates a different error callback.
Please see the session middleware configuration documentation.
type SessionExtractor ¶
type SessionExtractor interface {
SessionExtractor() extractors.Extractor
}
SessionExtractor is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Session, to indicates a different session ID extrator.
Please see the session middleware configuration documentation.
type SessionKeyGenerator ¶
type SessionKeyGenerator interface {
SessionKeyGenerator() func() string
}
SessionKeyGenerator is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Session, to indicates a different session ID generator.
Please see the session middleware configuration documentation.
type SessionNext ¶
SessionNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Session, to indicates when to skip it this middleware.
Please see the session middleware configuration documentation.
type SessionSecurityConfig ¶
type SessionSecurityConfig interface {
SessionSecurityConfig(server string, config *session.Config)
}
SessionSecurityConfig is an interface to be defined by a component that will customize the Session middleware when an HttpSecurity is defined for that server instance.
Please see the session middleware configuration documentation.
type SessionStore ¶
SessionStore is an interface implemented by Session itself to give access to its Session store.
It is referenced in the Csrf middleware, which may depend on it. Please see the session and csrf middleware configuration documentation.
type Static ¶
type Static struct {
// contains filtered or unexported fields
}
Static is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Static
}
func (this *ApiController) StaticConfig(config *static.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are StaticNext, StaticFS, StaticModifyResponse and StaticNotFoundHandler.
Also, the parent container may implements StaticConfig to receive a pointer to the static.Config that will be used.
Please see those interface definitions and the static middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: static: indexNames: ["index.html"] cacheDuration: 10s maxAge: 0 compress: false byteRange: false browse: false download: false
func (*Static) PostConstruct ¶
type StaticConfig ¶
StaticConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Static, to review the static.Config that will be configured by Static
Please see the static middleware configuration documentation.
type StaticFS ¶
StaticFS is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Static, to indicates the file system to serve the static files from.
Please see the static middleware configuration documentation.
type StaticModifyResponse ¶
StaticModifyResponse is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Static, to indicates a function that allows you to alter the response.
Please see the static middleware configuration documentation.
type StaticNext ¶
StaticNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Static, to indicates when to skip it this middleware.
Please see the static middleware configuration documentation.
type StaticNotFoundHandler ¶
StaticNotFoundHandler is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Static, to indicates a function to handle when the path is not found.
Please see the static middleware configuration documentation.
type Timeout ¶
type Timeout struct {
// contains filtered or unexported fields
}
Timeout is a middleware to be defined directly as an anonymous member inside a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter.
Example ¶
type ApiController struct {
FiberController
RequestMapping `Path:"/api"`
Timeout `Duration:"10s"`
}
func (this *ApiController) TimeoutConfig(config *timeout.Config) {
// changing configuration for this controller.
}
Configuration ¶
Its configuration is done through Rays configuration properties and through interfaces the parent github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements. Those interfaces are TimeoutNext, TimeoutOnTimeout and TimeoutErrors.
Also, the parent container may implements TimeoutConfig to receive a pointer to the timeout.Config that will be used.
You also have the possibility to define the timeout duration as a struct tag. See the example above.
Please see those interface definitions and the timeout middleware documentation.
Properties mapping : ¶
rays: fiber: servers: primary: timeout: timeout: 10s
func (*Timeout) Filter ¶
Filter() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberFilter
func (*Timeout) PostConstruct ¶
PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct
type TimeoutConfig ¶
TimeoutConfig is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Timeout, to review the timeout.Config that will be configured by Timeout
Please see the timeout middleware configuration documentation.
type TimeoutErrors ¶
type TimeoutErrors interface {
TimeoutErrors() []error
}
TimeoutErrors is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Timeout, to indicates custom errors treated as timeout errors.
Please see the timeout middleware configuration documentation.
type TimeoutNext ¶
TimeoutNext is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Timeout, to indicates when to skip it this middleware.
Please see the timeout middleware configuration documentation.
type TimeoutOnTimeout ¶
TimeoutOnTimeout is an interface a github.com/BeamFoundry/rays-fiber/pkg/core.FiberController or a github.com/BeamFoundry/rays-fiber/pkg/core.FilterPathFilter may implements, if it uses Timeout, to indicates a handler executed when a timeout occurs.
Please see the timeout middleware configuration documentation.