token

package
v0.0.0-...-47a55c7 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Key = "supersecretkey"

Variables

This section is empty.

Functions

func Encode

func Encode(_ context.Context, data UserPayload) (string, error)

Types

type UserClaims

type UserClaims struct {
	UserPayload
	jwt.RegisteredClaims
}

type UserPayload

type UserPayload struct {
	UserId   int64          `json:"user_id"`
	AuthType string         `json:"auth_type"`
	Role     constants.Role `json:"role"`
}

func Decode

func Decode(_ context.Context, tokenString string) (UserPayload, error)

Jump to

Keyboard shortcuts

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