pkg

package
v0.0.0-...-06bb1a6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(plainPassword string, hashPassword string) error

func GodotEnv

func GodotEnv(key string) string

func HashPassword

func HashPassword(password string) string

func SetupLogger

func SetupLogger()

func Sign

func Sign(Data map[string]interface{}, SecretPublicKeyEnvName string, ExpiredAt time.Duration) (string, error)

func VerifyToken

func VerifyToken(accessToken, SecretPublicKeyEnvName string) (*jwt.Token, error)

func VerifyTokenHeader

func VerifyTokenHeader(ctx *fiber.Ctx, SecretPublicKeyEnvName string) (*jwt.Token, error)

Types

type AccessToken

type AccessToken struct {
	Claims MetaToken
}

func DecodeToken

func DecodeToken(accessToken *jwt.Token) AccessToken

type Logger

type Logger struct {
	*logrus.Logger
}

func GetLogger

func GetLogger() *Logger

type MetaToken

type MetaToken struct {
	ID            string
	Email         string
	ExpiredAt     time.Time
	Authorization bool
}

Jump to

Keyboard shortcuts

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