user

package
v0.0.0-...-6c8972c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Permission

func Permission(ctx context.Context) map[string]storage.ResAct

Types

type CoreUser

type CoreUser interface {
	CreateUser(context.Context, storage.User) (string, error)
	UpdateUser(context.Context, storage.User) (*storage.User, error)
	DeleteUser(context.Context, storage.User) error
	GetUserByEmail(context.Context, string) (*storage.User, error)
	GetUserByID(context.Context, string) (*storage.User, error)
	GetUserByUsername(context.Context, string) (*storage.User, error)
	ListUsers(context.Context, storage.FilterUser) ([]storage.User, error)
	GetUserInformationByUserID(context.Context, string) (*storage.UserInformation, error)
	UpdateUserInformationByUserID(context.Context, storage.UserInformation) (*storage.UserInformation, error)
}

type Handler

type Handler struct {
	upb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func New

func New(usr CoreUser, logger *logrus.Entry) *Handler

func (*Handler) CreateUser

func (h *Handler) CreateUser(ctx context.Context, req *upb.CreateUserRequest) (*upb.CreateUserResponse, error)

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(ctx context.Context, req *upb.DeleteUserRequest) (*emptypb.Empty, error)

func (*Handler) GetUserByEmail

func (*Handler) GetUserByID

func (h *Handler) GetUserByID(ctx context.Context, req *upb.GetUserByIDRequest) (*upb.GetUserByIDResponse, error)

func (*Handler) GetUserByUsername

func (*Handler) ListUsers

func (*Handler) RegisterSvc

func (h *Handler) RegisterSvc(srv *grpc.Server) error

// RegisterService with grpc server.

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(ctx context.Context, req *upb.UpdateUserRequest) (*upb.UpdateUserResponse, error)

func (*Handler) ValidateRequestedData

func (h *Handler) ValidateRequestedData(ctx context.Context, req storage.User, id string) error

Jump to

Keyboard shortcuts

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