token

package
v0.0.0-...-64b4b4f Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Id string
	jwt.StandardClaims
}

type Interface

type Interface interface {
	IssueToken(userId string) (string, error)
	UserIdByToken(token string) (string, error)
}

type JwtHandler

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

todo: key rotation

func NewJwtHandler

func NewJwtHandler(privateBytes, publicBytes []byte, keyExpiration time.Duration) (*JwtHandler, error)

func (JwtHandler) IssueToken

func (j JwtHandler) IssueToken(userId string) (string, error)

func (JwtHandler) UserIdByToken

func (j JwtHandler) UserIdByToken(tokenString string) (string, error)

Jump to

Keyboard shortcuts

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