jwt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 5 Imported by: 0

README

xxx

介绍
  1. xxxx
  2. xxxx
  3. xxxx
安装教程

go get github.com/jageros/hawox

使用例子
package main

import (
	"fmt"
	"github.com/jageros/hawox/xxx"
)

func main() {
	/*
	xxxxx
	xxxxx
	xxxxx
	*/
}
使用说明
  1. xxxx
  2. xxxx
  3. xxxx

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(c *gin.Context)

func GenerateToken

func GenerateToken(uid string) (string, error)

func GenerateTokenWithTimeout

func GenerateTokenWithTimeout(uid string, timeout time.Duration) (string, error)

func RefreshToken

func RefreshToken(c *gin.Context) (string, bool)

func RefreshTokenByToken

func RefreshTokenByToken(token string, timeout ...time.Duration) (newToken string, err error)

func SetOption

func SetOption(opfs ...func(opt *Option))

func Uid

func Uid(c *gin.Context) (string, bool)

Types

type Claims

type Claims struct {
	Uid string `json:"uid"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

type Option

type Option struct {
	TokenHeaderKey string
	Secret         string
	Timeout        time.Duration
}

Jump to

Keyboard shortcuts

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