service

package
v0.0.0-...-8176360 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Types

type AuthSvc

type AuthSvc struct {
	// contains filtered or unexported fields
}

AuthSvc Service

func NewAuthSvc

func NewAuthSvc(urepo repository.UserRepository, log *logrus.Logger) *AuthSvc

NewAuthSvc Instantiate new auth Service

func (*AuthSvc) Login

func (s *AuthSvc) Login(ctx context.Context, login *pb.LoginDto) (*pb.AccessTokenDto, error)

Login ...

func (*AuthSvc) Register

func (s *AuthSvc) Register(ctx context.Context, udto *pb.RegisterDto) (*pb.UserAuthResDto, error)

Register ...

type GRPCService

type GRPCService struct {
	AuthSvc *AuthSvc
	// contains filtered or unexported fields
}

GRPCService ...

func BuildGRPCService

func BuildGRPCService(server *grpc.Server, repository repository.Repository) *GRPCService

BuildGRPCService register gRPC services implementation

type JwtClaims

type JwtClaims struct {
	jwt.StandardClaims
	UserID   string `json:"userid"`
	DeviceID string `json:"dvcid"`
	UserNo   int    `json:"userno"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
}

JwtClaims is wrapper for claiming JWT during login process

Jump to

Keyboard shortcuts

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