token

package
v0.0.0-...-d08f32a Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	// contains filtered or unexported fields
}

func New

func New(secret string) *Token

func (*Token) GenerateToken

func (t *Token) GenerateToken(userInfo *user.Info) (string, error)

GenerateToken Generates a _token_ based on the userInfo.

func (*Token) ParseFromContext

func (t *Token) ParseFromContext(ctx *gin.Context) (*user.Info, error)

func (*Token) ParseToken

func (t *Token) ParseToken(tokenStr string) (*user.Info, error)

ParseToken Parses the _token_ and returns the inner userInfo.

Jump to

Keyboard shortcuts

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