Back to

Package token

Latest Go to latest

The highest tagged major version is .

Published: Mar 23, 2020 | License: MPL-2.0 | Module:


type Claims

type Claims struct {
	Userid string `json:"userid"`
	ID     string `json:"id"`
	Key    string `json:"key"`

Claims is a set of fields to describe a user

type Service

type Service interface {

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier