util

package
v0.0.0-...-3909f8e Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

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

func GetDataFromHeaderWithKey

func GetDataFromHeaderWithKey(ctx context.Context, key string) (string, error)

func GinContextFromContext

func GinContextFromContext(ctx context.Context) (*gin.Context, error)

func RandomString

func RandomString(n int) string

func ValidateUserToken

func ValidateUserToken(ctx context.Context) (*entity.User, error)

Types

type Claims

type Claims struct {
	Id       string `json:"id"`
	Username string `json:"username"`
	jwt.StandardClaims
}

func ParseToken

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

Jump to

Keyboard shortcuts

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