jwt

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidToken returned by Decode when the token is invalid.
	ErrInvalidToken = errors.New("invalid token")
)

Functions

func Encode

func Encode(t *Token, secret []byte) (string, error)

Encode encodes and signs a JWT token.

func NewUUID

func NewUUID() string

NewUUID provides a new UUID.

Types

type Token

type Token struct {
	ID        string
	Issuer    string
	Subject   string
	Audience  string
	IssuedAt  int64
	ExpiresAt int64
	Duration  time.Duration
	CSRF      string
}

Token is a JSON Web Token.

func Decode

func Decode(t string, secret []byte) (*Token, bool, error)

Decode parses a token from a string format and returns a Token struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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