server

package
v0.0.0-...-931afa0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	auth.UnsafeAuthServiceServer
	TokenHandler util.TokenHandler
	Storage      storage.StorageInterface
	Logger       *logrus.Entry
	Config       *common.Config
}

Server implements the TaskServiceServer interface

func NewServer

func NewServer(cfg *common.Config) (*Server, error)

func (*Server) Login

func (s *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)

Login handles user login Check if user exist or not for email if yes, compare password hash

func (*Server) Logout

func (s *Server) Logout(ctx context.Context, req *pb.LogoutRequest) (*pb.LogoutResponse, error)

func (*Server) RenewAccessToken

func (s *Server) RenewAccessToken(ctx context.Context, req *pb.RenewAccessTokenRequest) (*pb.RenewAccessTokenResponse, error)

func (*Server) Signup

func (s *Server) Signup(ctx context.Context, req *pb.SignupRequest) (*pb.SignupResponse, error)

Signup handles user registration Checks if user already exist for email or not if yes, retrun error

func (*Server) Validate

func (s *Server) Validate(ctx context.Context, req *pb.ValidateRequest) (*pb.ValidateResponse, error)

Validate token and return

Jump to

Keyboard shortcuts

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