middleware

package
v0.0.0-...-026aa9f Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(db *gorm.DB, inputRole ...models.RoleId) gin.HandlerFunc

func CORS

func CORS() gin.HandlerFunc

func GetIdFromToken

func GetIdFromToken(c *gin.Context) (string, interface{})

func GetUserClaims

func GetUserClaims(c *gin.Context, db *gorm.DB, theValue string) (interface{}, error)

func GzipWithExclusion

func GzipWithExclusion(excludedPaths ...string) gin.HandlerFunc

GzipWithExclusion applies gzip compression conditionally based on the request path.

func Logger

func Logger() gin.HandlerFunc

func Metrics

func Metrics(cfg *config.Configuration) gin.HandlerFunc

func RateLimiter

func RateLimiter() gin.HandlerFunc

func Security

func Security() gin.HandlerFunc

Security middleware

func Throttle

func Throttle() gin.HandlerFunc

func TokenValid

func TokenValid(bearerToken string) (*jwt.Token, error)

check if token is valid

Types

type TokenDetailDTO

type TokenDetailDTO struct {
	AccessUuid  string `json:"access_uuid"`
	AccessToken string `json:"access_token"`
	ExpiresAt   time.Time
}

func CreateToken

func CreateToken(user models.User) (*TokenDetailDTO, error)

Jump to

Keyboard shortcuts

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