Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewMiddlewares), fx.Provide(NewPaginationMiddleware), fx.Provide(NewJWTAuthMiddleware), fx.Provide(NewDBTransactionMiddleware), )
Module Middleware exported
Functions ¶
This section is empty.
Types ¶
type DBTransactionMiddleware ¶
type DBTransactionMiddleware struct {
// contains filtered or unexported fields
}
DBTransactionMiddleware -> struct for transaction
func NewDBTransactionMiddleware ¶
func NewDBTransactionMiddleware( logger *lib.Logger, db *infrastructure.Database, ) *DBTransactionMiddleware
NewDBTransactionMiddleware -> new instance of transaction
func (DBTransactionMiddleware) Handle ¶
func (m DBTransactionMiddleware) Handle() fiber.Handler
Handle -> It setup the database transaction middleware
type JWTAuthMiddleware ¶
type JWTAuthMiddleware struct { JWTAuth *helpers.JWTAuth // contains filtered or unexported fields }
func NewJWTAuthMiddleware ¶
func NewJWTAuthMiddleware( logger *lib.Logger, jwtHelper *helpers.JWTAuth, db *infrastructure.Database, ) *JWTAuthMiddleware
func (JWTAuthMiddleware) Handle ¶
func (m JWTAuthMiddleware) Handle(tokenType string, needUser bool) fiber.Handler
type Middlewares ¶
type Middlewares []IMiddleware
Middlewares contains multiple middleware
func NewMiddlewares ¶
func NewMiddlewares() *Middlewares
NewMiddlewares creates new middlewares Register the middleware that should be applied directly (globally)
type Option ¶
type Option func(*RateLimitOption)
type PaginationMiddleware ¶
type PaginationMiddleware struct {
// contains filtered or unexported fields
}
func NewPaginationMiddleware ¶
func NewPaginationMiddleware(logger *lib.Logger) *PaginationMiddleware
func (PaginationMiddleware) Handle ¶
func (p PaginationMiddleware) Handle() fiber.Handler
func (PaginationMiddleware) HandleCursor ¶
func (p PaginationMiddleware) HandleCursor() fiber.Handler
type RateLimitMiddleware ¶
type RateLimitMiddleware struct {
// contains filtered or unexported fields
}
func NewRateLimitMiddleware ¶
func NewRateLimitMiddleware(logger *lib.Logger) *RateLimitMiddleware
type RateLimitOption ¶
type RateLimitOption struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.