jwt

package
v0.3.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

* @Author: LinkLeong link@icewhale.com * @Date: 2021-09-30 18:18:14 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-24 10:02:46 * @FilePath: /CasaOS/pkg/utils/jwt/jwt.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.

* @Author: LinkLeong link@icewhale.com * @Date: 2022-06-17 14:01:25 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-24 10:13:52 * @FilePath: /CasaOS/pkg/utils/jwt/jwt_helper.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(username, password string) (string, error)

创建token

func GetToken

func GetToken(username, pwd string) string

获取token

func JWT

func JWT() gin.HandlerFunc

Types

type Claims

type Claims struct {
	UserName string `json:"username"`
	PassWord string `json:"password"`
	jwt.StandardClaims
}

func ParseToken

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

解析token

Jump to

Keyboard shortcuts

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