auth

package
v0.0.0-...-615e99e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

type JWT struct {
	SigningKey []byte
}

func NewJWT

func NewJWT() *JWT

func (*JWT) CreateToken

func (j *JWT) CreateToken(claim *JwtClaims, expireAt time.Duration) (string, error)

func (*JWT) ParseToken

func (j *JWT) ParseToken(tokenString string) (*JwtClaims, error)

type JwtClaims

type JwtClaims struct {
	ID       int64   `json:"id"`
	SystemID int64   `json:"system_id"`
	Account  string  `json:"account"`
	RoleIDs  []int64 `json:"role_ids"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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