utils

package
v0.0.0-...-d4bccd0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(config *configs.AppConfig) *gorm.DB

func InitRedis

func InitRedis(config *configs.AppConfig) *redis.Client

func InitialMigration

func InitialMigration(db *gorm.DB)

Types

type JWTClaimResult

type JWTClaimResult struct {
	Expired   time.Time
	AuthToken string
}

func ClaimToken

func ClaimToken(user entities.User, config configs.AppConfig) (JWTClaimResult, error)

type JWTCustomClaims

type JWTCustomClaims struct {
	Email string `json:"email"`
	Admin bool   `json:"admin"`
	jwt.StandardClaims
}

JWTCustomClaims are custom claims extending default ones. See https://github.com/golang-jwt/jwt for more examples

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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