auth

package
v0.0.0-...-4db77b6 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 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 ITokenManager

type ITokenManager interface {
	// UserIDを含む期限付きのトークンを生成する
	CreateToken(userID string, duration time.Duration) (string, error)

	// トークンからUserIDを取得する
	GetUserID(token string) (string, error)
}

JWTの操作

type TokenManager

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

func NewTokenManager

func NewTokenManager(issuer string, keyPath string) (*TokenManager, error)

func (*TokenManager) CreateToken

func (m *TokenManager) CreateToken(userID string, duration time.Duration) (string, error)

func (*TokenManager) GetUserID

func (m *TokenManager) GetUserID(token string) (string, error)

Jump to

Keyboard shortcuts

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