controller

package
v0.0.0-...-5e1236a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) (string, error)

func VerifyPassword

func VerifyPassword(hashedPassword string, candidatePassword string) error

Types

type AuthUserResponse

type AuthUserResponse struct {
	ID    string `json:"id" mapstructure:"id"`
	Token string `json:"token" mapstructure:"token"`
}

func Login

func Login(
	ctx context.Context,
	userClient pbUser.UserClient,
	jwtManager *usecase.JWTManager,
	req *pbGateway.LoginRequest,
) (*AuthUserResponse, error)

func RegisterUser

func RegisterUser(
	ctx context.Context,
	userClient pbUser.UserClient,
	jwtManager *usecase.JWTManager,
	req *pbGateway.RegisterUserRequest,
) (*AuthUserResponse, error)

type UserClaim

type UserClaim struct {
	ID   string          `json:"id"`
	Role pbUser.UserRole `json:"role"`
}

Jump to

Keyboard shortcuts

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