middleware

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Index

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

func (this *BasicAuth) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*BasicAuth) PostConstruct

func (this *BasicAuth) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type BasicAuthAuthorizer

type BasicAuthAuthorizer interface {
	BasicAuthAuthorizer() func(string, string, fiber.Ctx) bool
}

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

type BasicAuthBadRequest interface {
	BasicAuthBadRequest() fiber.Handler
}

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

type BasicAuthConfig interface {
	BasicAuthConfig(config *basicauth.Config)
}

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

type BasicAuthNext interface {
	BasicAuthNext() func(fiber.Ctx) bool
}

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() fiber.Handler
}

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) Handler

func (this *Cache) Handler() fiber.Handler

func (*Cache) PostConstruct

func (this *Cache) PostConstruct(parent any) Error

type CacheConfig

type CacheConfig interface {
	CacheConfig(config *cache.Config)
}

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

type CacheInvalidator interface {
	CacheInvalidator() func(fiber.Ctx) bool
}

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

type CacheKeyGenerator interface {
	CacheKeyGenerator() func(fiber.Ctx) string
}

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

type CacheNext interface {
	CacheNext() func(fiber.Ctx) bool
}

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

func (this *Compress) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Compress) PostConstruct

func (this *Compress) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type CompressConfig

type CompressConfig interface {
	CompressConfig(config *compress.Config)
}

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

type CompressNext interface {
	CompressNext() func(fiber.Ctx) bool
}

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

func (this *Cors) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Cors) PostConstruct

func (this *Cors) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type CorsAllowOriginsFunc

type CorsAllowOriginsFunc interface {
	CorsAllowOriginsFunc() func(origin string) bool
}

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

type CorsConfig interface {
	CorsConfig(config *cors.Config)
}

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

type CorsNext interface {
	CorsNext() func(fiber.Ctx) bool
}

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

func (this *Csrf) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Csrf) PostConstruct

func (this *Csrf) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type CsrfConfig

type CsrfConfig interface {
	CsrfConfig(config *csrf.Config)
}

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

type CsrfErrorHandler interface {
	CsrfErrorHandler() func(fiber.Ctx, error) error
}

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

type CsrfNext interface {
	CsrfNext() func(fiber.Ctx) bool
}

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

type CsrfSecurityConfig interface {
	CsrfSecurityConfig(server string, config *csrf.Config)
}

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

func (this *EarlyData) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*EarlyData) PostConstruct

func (this *EarlyData) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type EarlyDataAllowEarlyData

type EarlyDataAllowEarlyData interface {
	EarlyDataAllowEarlyData() func(c fiber.Ctx) bool
}

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

type EarlyDataConfig interface {
	EarlyDataConfig(config *earlydata.Config)
}

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

type EarlyDataIsEarlyData interface {
	EarlyDataIsEarlyData() func(c fiber.Ctx) bool
}

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

type EarlyDataNext interface {
	EarlyDataNext() func(fiber.Ctx) bool
}

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

type EncryptCookieNext interface {
	EncryptCookieNext() func(fiber.Ctx) bool
}

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

func (this *EnvVar) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*EnvVar) PostConstruct

func (this *EnvVar) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type EnvVarConfig

type EnvVarConfig interface {
	EnvVarConfig(config *envvar.Config)
}

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

func (this *Etag) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Etag) PostConstruct

func (this *Etag) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type EtagConfig

type EtagConfig interface {
	EtagConfig(config *etag.Config)
}

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

type EtagNext interface {
	EtagNext() func(fiber.Ctx) bool
}

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

func (this *ExpVar) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*ExpVar) PostConstruct

func (this *ExpVar) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type ExpVarConfig

type ExpVarConfig interface {
	ExpVarConfig(config *expvar.Config)
}

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

type ExpVarNext interface {
	ExpVarNext() func(fiber.Ctx) bool
}

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

func (this *Favicon) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Favicon) PostConstruct

func (this *Favicon) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type FaviconConfig

type FaviconConfig interface {
	FaviconConfig(config *favicon.Config)
}

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

type FaviconFileSystem interface {
	FaviconFileSystem() fs.FS
}

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

type FaviconNext interface {
	FaviconNext() func(fiber.Ctx) bool
}

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

type HealthCheckNext interface {
	HealthCheckNext() func(fiber.Ctx) bool
}

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

type HealthCheckProbe interface {
	HealthCheckProbe() func(fiber.Ctx) bool
}

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) Handler

func (this *Helmet) Handler() fiber.Handler

func (*Helmet) PostConstruct

func (this *Helmet) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type HelmetConfig

type HelmetConfig interface {
	HelmetConfig(config *helmet.Config)
}

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

type HelmetNext interface {
	HelmetNext() func(fiber.Ctx) bool
}

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

type HostAuthorizationNext interface {
	HostAuthorizationNext() func(fiber.Ctx) bool
}

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

type IdempotencyKeyHeaderValidate interface {
	IdempotencyKeyHeaderValidate() func(string) error
}

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

type IdempotencyNext interface {
	IdempotencyNext() func(fiber.Ctx) bool
}

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

func (this *KeyAuth) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*KeyAuth) PostConstruct

func (this *KeyAuth) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type KeyAuthConfig

type KeyAuthConfig interface {
	KeyAuthConfig(config *keyauth.Config)
}

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

type KeyAuthNext interface {
	KeyAuthNext() func(fiber.Ctx) bool
}

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

type KeyAuthSuccessHandler interface {
	KeyAuthSuccessHandler() fiber.Handler
}

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

type KeyAuthValidator interface {
	KeyAuthValidator() func(fiber.Ctx, string) (bool, error)
}

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

func (this *Limiter) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Limiter) PostConstruct

func (this *Limiter) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type LimiterConfig

type LimiterConfig interface {
	LimiterConfig(config *limiter.Config)
}

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

type LimiterKeyGenerator interface {
	LimiterKeyGenerator() func(fiber.Ctx) string
}

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

type LimiterLimitReached interface {
	LimiterLimitReached() fiber.Handler
}

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

type LimiterMaxFunc interface {
	LimiterMaxFunc() func(c fiber.Ctx) int
}

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

type LimiterNext interface {
	LimiterNext() func(fiber.Ctx) bool
}

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

func (this *Logger) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Logger) PostConstruct

func (this *Logger) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type LoggerBeforeHandlerFunc

type LoggerBeforeHandlerFunc interface {
	LoggerBeforeHandlerFunc() func(*logger.Config)
}

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

type LoggerConfig interface {
	LoggerConfig(config *logger.Config)
}

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

type LoggerCustomTags interface {
	LoggerCustomTags() map[string]logger.LogFunc
}

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

type LoggerDone interface {
	LoggerDone() func(c fiber.Ctx, logString []byte)
}

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

type LoggerNext interface {
	LoggerNext() func(fiber.Ctx) bool
}

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

type LoggerSkip interface {
	LoggerSkip() func(fiber.Ctx) bool
}

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) Handler

func (this *Paginate) Handler() fiber.Handler

func (*Paginate) PostConstruct

func (this *Paginate) PostConstruct(parent any) Error

type PaginateConfig

type PaginateConfig interface {
	PaginateConfig(config *paginate.Config)
}

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

type PaginateNext interface {
	PaginateNext() func(fiber.Ctx) bool
}

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

func (this *Pprof) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Pprof) PostConstruct

func (this *Pprof) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type PprofConfig

type PprofConfig interface {
	PprofConfig(config *pprof.Config)
}

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

type PprofNext interface {
	PprofNext() func(fiber.Ctx) bool
}

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

func (this *Recover) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Recover) PostConstruct

func (this *Recover) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type RecoverConfig

type RecoverConfig interface {
	RecoverConfig(config *recover.Config)
}

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

type RecoverNext interface {
	RecoverNext() func(fiber.Ctx) bool
}

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

type RecoverPanicHandler interface {
	RecoverPanicHandler() func(c fiber.Ctx, e any) error
}

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

type RecoverStackTraceHandler interface {
	RecoverStackTraceHandler() func(c fiber.Ctx, e any)
}

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

func (this *Redirect) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Redirect) PostConstruct

func (this *Redirect) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type RedirectConfig

type RedirectConfig interface {
	RedirectConfig(config *redirect.Config)
}

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

type RedirectNext interface {
	RedirectNext() func(fiber.Ctx) bool
}

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

func (this *RequestID) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*RequestID) PostConstruct

func (this *RequestID) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type RequestIDConfig

type RequestIDConfig interface {
	RequestIDConfig(config *requestid.Config)
}

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

type RequestIDNext interface {
	RequestIDNext() func(fiber.Ctx) bool
}

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

func (this *Rewrite) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Rewrite) PostConstruct

func (this *Rewrite) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type RewriteConfig

type RewriteConfig interface {
	RewriteConfig(config *rewrite.Config)
}

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

type RewriteNext interface {
	RewriteNext() func(fiber.Ctx) bool
}

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

func (this *Session) Handler() fiber.Handler

Handler() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberHandler

func (*Session) PostConstruct

func (this *Session) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

func (*Session) SessionStore

func (this *Session) SessionStore() *session.Store

SessionStore() implements SessionStore.

type SessionConfig

type SessionConfig interface {
	SessionConfig(config *session.Config)
}

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

type SessionErrorHandler interface {
	SessionErrorHandler() func(fiber.Ctx, error)
}

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

type SessionNext interface {
	SessionNext() func(fiber.Ctx) bool
}

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

type SessionStore interface {
	SessionStore() *session.Store
}

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) Handler

func (this *Static) Handler() fiber.Handler

func (*Static) PostConstruct

func (this *Static) PostConstruct(parent any) Error

type StaticConfig

type StaticConfig interface {
	StaticConfig(config *static.Config)
}

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

type StaticFS interface {
	StaticFS() fs.FS
}

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

type StaticModifyResponse interface {
	StaticModifyResponse() fiber.Handler
}

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

type StaticNext interface {
	StaticNext() func(fiber.Ctx) bool
}

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

type StaticNotFoundHandler interface {
	StaticNotFoundHandler() fiber.Handler
}

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

func (this *Timeout) Filter(handler fiber.Handler) fiber.Handler

Filter() implements github.com/BeamFoundry/rays-fiber/pkg/core.FiberFilter

func (*Timeout) PostConstruct

func (this *Timeout) PostConstruct(parent any) Error

PostConstruct() implements github.com/BeamFoundry/rays/pkg/core.InnerBeamPostConstruct

type TimeoutConfig

type TimeoutConfig interface {
	TimeoutConfig(config *timeout.Config)
}

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

type TimeoutNext interface {
	TimeoutNext() func(fiber.Ctx) bool
}

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

type TimeoutOnTimeout interface {
	TimeoutOnTimeout() fiber.Handler
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL