auth

package
v0.0.0-...-82113cf Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manger

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

func NewManager

func NewManager(secret string) *Manger

func (*Manger) NewJWT

func (m *Manger) NewJWT(userId int, ttl time.Duration) (string, error)

func (*Manger) NewRefreshToken

func (m *Manger) NewRefreshToken() (string, error)

func (*Manger) ParseToken

func (m *Manger) ParseToken(accessToken string) (int, error)

type TokenManager

type TokenManager interface {
	NewJWT(userId int, ttl time.Duration) (string, error)
	NewRefreshToken() (string, error)
	ParseToken(accessToken string) (int, error)
}

Jump to

Keyboard shortcuts

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