middlewares

package
v0.0.0-...-474b416 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: 0BSD Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module Middleware exported

Functions

This section is empty.

Types

type CorsMiddleware

type CorsMiddleware struct {
	// contains filtered or unexported fields
}

CorsMiddleware middleware for cors

func NewCorsMiddleware

func NewCorsMiddleware(handler *core.RequestHandler, logger *core.Logger, env *core.Env) *CorsMiddleware

NewCorsMiddleware creates new cors middleware

func (*CorsMiddleware) Setup

func (m *CorsMiddleware) Setup()

Setup sets up cors middleware

type IMiddleware

type IMiddleware interface {
	Setup()
}

IMiddleware middleware interface

type JWTMiddleware

type JWTMiddleware struct {
	// contains filtered or unexported fields
}

JWTMiddleware middleware for jwt authentication

func NewJWTMiddleware

func NewJWTMiddleware(
	env *core.Env,
	logger *core.Logger,
	service services.IAuthService,
) *JWTMiddleware

NewJWTMiddleware creates new jwt auth middleware

func (*JWTMiddleware) AuthorizationWithCookie

func (m *JWTMiddleware) AuthorizationWithCookie() gin.HandlerFunc

func (*JWTMiddleware) Handler

func (m *JWTMiddleware) Handler() gin.HandlerFunc

Handler handles middleware functionality

func (*JWTMiddleware) Setup

func (m *JWTMiddleware) Setup()

Setup sets up jwt auth middleware

type Middlewares

type Middlewares []IMiddleware

Middlewares contains multiple middleware

func NewMiddlewares

func NewMiddlewares(
	corsMiddleware *CorsMiddleware,
	jwtMiddleware *JWTMiddleware,
) Middlewares

NewMiddlewares creates new middlewares Register the middleware that should be applied directly (globally)

func (Middlewares) Setup

func (m Middlewares) Setup()

Setup sets up middlewares

Jump to

Keyboard shortcuts

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