Documentation
¶
Index ¶
- type Handler
- func (h *Handler) HealthCheck(ctx context.Context, req *emptypb.Empty) (*gen.HealthResponse, error)
- func (h *Handler) Login(ctx context.Context, req *gen.AuthenticateRequest) (*gen.AuthenticateResponse, error)
- func (h *Handler) PasswordRecover(ctx context.Context, req *gen.PasswordRecoveryRequest) (*gen.PasswordRecoveryResponse, error)
- func (h *Handler) PasswordReset(ctx context.Context, req *gen.PasswordResetRequest) (*gen.PasswordResetResponse, error)
- func (h *Handler) Profile(ctx context.Context, req *gen.ProfileRequest) (*gen.ProfileResponse, error)
- func (h *Handler) Register(ctx context.Context, req *gen.RegisterRequest) (*gen.RegisterResponse, error)
- func (h *Handler) RegisterConfirm(ctx context.Context, req *gen.RegisterConfirmRequest) (*gen.RegisterConfirmResponse, error)
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 (*Handler) HealthCheck ¶
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 ¶
func (h *Handler) Login(ctx context.Context, req *gen.AuthenticateRequest) (*gen.AuthenticateResponse, error)
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 ¶
func (h *Handler) PasswordRecover(ctx context.Context, req *gen.PasswordRecoveryRequest) (*gen.PasswordRecoveryResponse, error)
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 ¶
func (h *Handler) PasswordReset(ctx context.Context, req *gen.PasswordResetRequest) (*gen.PasswordResetResponse, error)
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 ¶
func (h *Handler) RegisterConfirm(ctx context.Context, req *gen.RegisterConfirmRequest) (*gen.RegisterConfirmResponse, error)
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.