token

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MPL-2.0 Imports: 7 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 {
	jwt.StandardClaims
	Userid string `json:"userid"`
	ID     string `json:"id"`
	Key    string `json:"key"`
}

Claims is a set of fields to describe a user

type Service added in v0.2.5

type Service interface {
	governor.Service
	Tokenizer
}

func New

func New() Service

New creates a new Tokenizer

type Tokenizer

type Tokenizer interface {
	Generate(userid string, duration int64, subject, id, key string) (string, *Claims, error)
	GenerateFromClaims(claims *Claims, duration int64, subject, key string) (string, *Claims, error)
	Validate(tokenString, subject string) (bool, *Claims)
	GetClaims(tokenString, subject string) (bool, *Claims)
}

Tokenizer is a token generator

Jump to

Keyboard shortcuts

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