middleware

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PAGE_TEXT    = "page"
	DEFAULT_SIZE_TEXT    = "size"
	DEFAULT_PAGE         = "1"
	DEFAULT_PAGE_SIZE    = "10"
	DEFAULT_MIN_PAGESIZE = 4
	DEFAULT_MAX_PAGESIZE = 50
)
View Source
const JWT_KEY = "JWT_PAYLOAD"

Variables

This section is empty.

Functions

func CreateJWTMiddleware

func CreateJWTMiddleware() gin.HandlerFunc

func Default added in v0.0.3

func Default() gin.HandlerFunc

Default Create a new pagination middleware with default values

func GetJWTClaims

func GetJWTClaims(c *gin.Context) (jwt.MapClaims, error)

func New added in v0.0.3

func New(pageText, sizeText, defaultPage, defaultPageSize string, minPageSize, maxPageSize int) gin.HandlerFunc

New Create a new pagniation middleware with custom values

Types

type User

type User struct {
	Name string
	Role string
}

Jump to

Keyboard shortcuts

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