auth

package
v2.3.14 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func (Auth) Authenticate added in v2.0.4

func (a Auth) Authenticate(c *gin.Context)

func (Auth) CanPermission added in v2.0.4

func (a Auth) CanPermission(c *gin.Context)

func (Auth) GetAdminID added in v2.1.0

func (a Auth) GetAdminID() int

func (Auth) InitHandler added in v2.0.4

func (a Auth) InitHandler(api *gin.RouterGroup)

type Config

type Config struct {
	Debug         string
	DB            *gorm.DB
	Rdb           redis.UniversalClient
	Transaction   mw.ITransaction
	Hasher        secret.Hasher
	AccessExpire  time.Duration
	RefreshExpire time.Duration
	AccessSecret  string
	Permissions   []model.Permission
}

type IAuth

type IAuth interface {
	InitHandler(api *gin.RouterGroup)
	Authenticate(c *gin.Context)
	CanPermission(c *gin.Context)
	GetAdminID() int
}

func New

func New(cfg Config) (IAuth, error)

Jump to

Keyboard shortcuts

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