token

package
v0.0.0-...-cee1f35 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJWInvalid = errors.New("token is invalid")

Functions

func GenerateRefresh

func GenerateRefresh(length int) (string, error)

GenerateRefresh will generate a cryptographically random base64 string

Types

type JW

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

func NewJW

func NewJW(secret, username string, exp time.Duration) *JW

func NewJWFromExisting

func NewJWFromExisting(secret, tokenStr string) (*JW, error)

func (*JW) ExpiresIn

func (t *JW) ExpiresIn() time.Duration

func (*JW) Generate

func (t *JW) Generate() error

func (*JW) IsExpired

func (t *JW) IsExpired() bool

func (*JW) Token

func (t *JW) Token() string

Jump to

Keyboard shortcuts

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