sercurity

package
v0.0.0-...-a4deb0f Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SECRET_KEY_ADMIN = "learngolanglalalafdfds"
View Source
const SECRET_KEY_USERS = "userssecretkeylear"

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd []byte) bool

func GenTokenAdmin

func GenTokenAdmin(user admin_dto.Admin) (string, error)

func GenTokenUsers

func GenTokenUsers(user usersdto.Users) (string, error)

Types

type JwtCustomClaims

type JwtCustomClaims struct {
	UserId string
	Role   string
	jwt.StandardClaims
}

type JwtCustomClaimsUsers

type JwtCustomClaimsUsers struct {
	UserId string
	Role   string
	jwt.StandardClaims
}

type Role

type Role int
const (
	ADMIN Role = iota
	USERS
	DRIVER
	SHOP
)

func (Role) String

func (r Role) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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