util

package
v0.0.0-...-0bd68be Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BcryptManager

type BcryptManager struct {
}

func (*BcryptManager) CompareHashedPassword

func (bm *BcryptManager) CompareHashedPassword(hashedPassword string, password string) (bool, error)

func (*BcryptManager) HashPassword

func (bm *BcryptManager) HashPassword(password string) (string, error)

type IBcryptManager

type IBcryptManager interface {
	HashPassword(password string) (string, error)
	CompareHashedPassword(hashedPassword string, password string) (bool, error)
}

type IJwtManager

type IJwtManager interface {
	GenerateToken(userId string) (token string, err error)
	ValidateToken(token string) (userId string, err error)
}

type JwtManager

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

func NewJwtManager

func NewJwtManager(secret string) *JwtManager

func (*JwtManager) GenerateToken

func (jm *JwtManager) GenerateToken(userId string, expiration time.Duration) (token string, err error)

func (*JwtManager) ValidateToken

func (jm *JwtManager) ValidateToken(token string) (userId string, err error)

Jump to

Keyboard shortcuts

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