service

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

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotActivated          = errors.New("user is not activated")
	ErrInvalidUsernameOrPassword = errors.New("invalid username or password")
)

Functions

func NewProfileServiceClient

func NewProfileServiceClient(address string) (pb.ProfileServiceClient, error)

Types

type JWTManager

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

func NewJWTManager

func NewJWTManager(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) *JWTManager

func (*JWTManager) GenerateAccessToken

func (manager *JWTManager) GenerateAccessToken(user *model.User) (string, error)

type UserService

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

func NewUserService

func NewUserService(store store.UserStore, jwtManager *JWTManager, profileServiceClient pb.ProfileServiceClient) *UserService

func (*UserService) GetCurrentUser

func (service *UserService) GetCurrentUser(ctx context.Context) (*pb.UserResponse, error)

func (*UserService) Login

func (service *UserService) Login(request *pb.LoginUserRequest) (*pb.UserResponse, error)

func (*UserService) Register

func (service *UserService) Register(request *pb.NewUserRequest) (*pb.UserResponse, error)

func (*UserService) UpdateCurrentUser

func (service *UserService) UpdateCurrentUser(ctx context.Context, request *pb.UpdateUserRequest) (*pb.UserResponse, error)

Jump to

Keyboard shortcuts

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