middleware

package
v0.0.0-...-56fc341 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

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

func NewMiddleware

func NewMiddleware(accessTokenSecretKey string, middlewareTokenRepo MiddlewareTokenRepo, middlewareUserRepo MiddlewareUserRepo) *Middleware

func (*Middleware) Authentication

func (m *Middleware) Authentication() gin.HandlerFunc

func (*Middleware) Authorization

func (m *Middleware) Authorization(roles []user.Role) gin.HandlerFunc

func (*Middleware) JsonMiddleware

func (m *Middleware) JsonMiddleware() gin.HandlerFunc

type MiddlewareTokenRepo

type MiddlewareTokenRepo interface {
	FindToken(accessuuid string) (string, error)
	DeleteToken(accessUuid string) error
}

type MiddlewareUserRepo

type MiddlewareUserRepo interface {
	GetUser(filter interface{}) (*user.User, error)
}

Jump to

Keyboard shortcuts

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