auth

package
v0.0.0-...-42463de Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExpiredTokenTime = 2 * time.Hour
)

Variables

View Source
var (
	ErrSignTokenFailed = errcode.ErrorUnauthorized("Failed to sign token")
	ErrTokenInvalid    = errcode.ErrorUnauthorized("Token is invalid")
	ErrTokenExpired    = errcode.ErrorUnauthorized("Token is expired")
)

Functions

This section is empty.

Types

type AuthnInterface

type AuthnInterface interface {
	Sign(ctx context.Context, userId int64) (string, error)
	Destroy(ctx context.Context, accessToken string) error
	Verify(ctx context.Context, accessToken string) (int64, error)
}

func NewAuthnInterface

func NewAuthnInterface(cache redis.Cmdable, c *conf.Jwt) AuthnInterface

Jump to

Keyboard shortcuts

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