token

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_INVALID_CLAIM = "Invalid claim"
	ERR_AUTORIZATION  = "Invalid autorization"
)

Variables

This section is empty.

Functions

func Generate

func Generate(clientId, name, app, kind, device string, expired time.Duration) (string, error)

Generate method to use in token

Types

type Claim

type Claim struct {
	ClientId string        `json:"clientId"`
	Name     string        `json:"name"`
	Iat      time.Time     `json:"iat"`
	Exp      time.Duration `json:"exp"`
	App      string        `json:"app"`
	Kind     string        `json:"kind"`
	Device   string        `json:"device"`
	jwt.StandardClaims
}

func Validate

func Validate(tokenString string) (*Claim, error)

Validate method to use in token

Jump to

Keyboard shortcuts

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