jwt

package
v0.0.0-...-8fe00be Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

* @FilePath: /workflow-server/pkg/jwt/jwt.go * @Author: maggot-code * @Date: 2023-08-15 20:41:15 * @LastEditors: maggot-code * @LastEditTime: 2023-08-16 01:48:09 * @Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Issue

func Issue(key string, mc *MetadataClaims) (string, error)

func NeedRefresh

func NeedRefresh(term time.Duration, mc *MetadataClaims) bool

根据term时间判断是否需要刷新token

func Refresh

func Refresh(key string, exp time.Time, mc *MetadataClaims) (string, error)

Types

type MetadataClaims

type MetadataClaims struct {
	jwt.RegisteredClaims
	Metadata interface{} `json:"metadata"`
}

func New

func New(uer string, exp time.Time, metadata interface{}) *MetadataClaims

func Parse

func Parse(key, str string) (*MetadataClaims, error)

Jump to

Keyboard shortcuts

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