grpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	gen.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

Handler defines a Auth gRPC handler.

func New

func New(ctrl *auth.Controller) *Handler

New creates a new Auth gRPC handler.

func (*Handler) HealthCheck

func (h *Handler) HealthCheck(ctx context.Context, req *emptypb.Empty) (*gen.HealthResponse, error)

HealthCheck handles the gRPC request for checking the health status of the application. It delegates the call to the controller and converts the result into a protobuf response.

func (*Handler) Login

Login handles the gRPC request to authenticate a user. It converts the protobuf request to internal format, delegates to the controller, and returns the authentication response or an error if authentication fails.

func (*Handler) PasswordRecover

PasswordRecover handles the gRPC request to initiate the password recovery process. It validates the request, converts it to internal format, delegates to the controller for further processing, and returns success or an error if password recovery fails.

func (*Handler) PasswordReset

PasswordReset handles the gRPC request to reset a user's password. It verifies the request, converts it to internal format, delegates to the controller, and returns success or an error if the password reset fails.

func (*Handler) Profile

func (h *Handler) Profile(ctx context.Context, req *gen.ProfileRequest) (*gen.ProfileResponse, error)

Profile handles the gRPC request to fetch the user profile based on the current user ID in the context. It verifies the presence of the user ID in the context, retrieves the user profile through the controller, and returns the profile information or an error if fetching the profile fails.

func (*Handler) Register

func (h *Handler) Register(ctx context.Context, req *gen.RegisterRequest) (*gen.RegisterResponse, error)

Register handles user registration by converting the gRPC request to internal format, delegating to the controller, and returning the registered user's ID or an error.

func (*Handler) RegisterConfirm

RegisterConfirm handles the gRPC request to confirm user registration. It verifies the token from the request, delegates to the controller for confirmation, and returns success or an error if confirmation fails.

Jump to

Keyboard shortcuts

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