token

package
v0.0.0-...-bac0e4b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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 Jwt

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

todo: key rotation

func NewJwt

func NewJwt(privateBytes, publicBytes []byte, keyExpiration time.Duration) (*Jwt, error)

func (Jwt) IssueToken

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

func (Jwt) UserIdByToken

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

Jump to

Keyboard shortcuts

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