middleware

package
v0.0.0-...-410c955 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizationHeader = "Authorization"
View Source
const BearerHeader = "Bearer "
View Source
const UserKey = "UserKey"

Variables

This section is empty.

Functions

func GetUser

func GetUser(c *gin.Context) (*models.User, error)

func SkipHandler

func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool

func UserAuth

func UserAuth(skippers Skippers, geter UserGetter) gin.HandlerFunc

Types

type SkipperFunc

type SkipperFunc func(*gin.Context) bool

func AllowPathPrefixSkipper

func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc

type Skippers

type Skippers []SkipperFunc

type UserGetter

type UserGetter func(AuthKey string) (*models.User, error)

Jump to

Keyboard shortcuts

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