handlers

package
v0.0.0-...-1015d97 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiLimiter = limiter.New(limiter.Config{
	Max:        750,
	Expiration: 30 * time.Second,
	KeyGenerator: func(c *fiber.Ctx) string {
		return c.Get(fiber.HeaderXForwardedFor)
	},
	LimitReached: func(c *fiber.Ctx) error {
		return utils.NewError(http.StatusTooManyRequests, utils.WhereAmI(), http.StatusText(http.StatusTooManyRequests))
	},
})

Functions

func ExtractBearerToken

func ExtractBearerToken(authHeader string) (token string, err error)

func ExtractLevel

func ExtractLevel(aud []string) (level int, err error)

func ExtractSocketToken

func ExtractSocketToken(authHeader string) (token string, err error)

func Index

func Index() fiber.Handler

Types

type RouterResources

type RouterResources struct {
	JwtKeyfunc jwt.Keyfunc
}

RouterResources DB handler

func NewRouterResources

func NewRouterResources(jwtKeyfunc jwt.Keyfunc) *RouterResources

NewRouterResources returns a new DBHandler

func (*RouterResources) ReqAuthHandler

func (r *RouterResources) ReqAuthHandler(reqLevels ...int) fiber.Handler

ReqLineAuthHandler check session

Jump to

Keyboard shortcuts

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