gauth

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 7 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 NewAuth

func NewAuth(redis *redis.Client, secret []byte) *Auth

func (*Auth) CreateRefreshToken

func (auth *Auth) CreateRefreshToken(id int64, username string, role int16) (refresh_uuid string)

func (*Auth) CreateSessionToken

func (auth *Auth) CreateSessionToken(refresh_uuid string) (session_uuid string)

func (*Auth) DeleteRefreshToken added in v1.0.1

func (auth *Auth) DeleteRefreshToken(refresh_uuid string)

func (*Auth) DeleteSessionToken added in v1.0.1

func (auth *Auth) DeleteSessionToken(session_uuid string)

func (*Auth) SetPrefix added in v1.0.7

func (auth *Auth) SetPrefix(prefix string)

func (*Auth) VerifyRefreshToken

func (auth *Auth) VerifyRefreshToken(refresh_uuid string) *Token

func (*Auth) VerifySessionToken

func (auth *Auth) VerifySessionToken(session_uuid string) (refresh_uuid string)

type Token

type Token struct {
	ID         int64
	Username   string
	Role       int16
	Expiration int64
}

Jump to

Keyboard shortcuts

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