user

package
v0.0.0-...-4f9ff06 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Get(ctx context.Context, id int64) (user *entity.User, err error)
	GetByEmail(ctx context.Context, email string) (user *entity.User, err error)
}

Reader interface

type Repository

type Repository interface {
	Reader
	Writer
}

Repository interface

type Service

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

Service user usecase

func NewService

func NewService(repo Repository, cacheSvc cache.Service) *Service

NewService create new service

func (*Service) CreateUser

func (s *Service) CreateUser(ctx context.Context, payload entity.Signup) error

CreateUser ...

func (*Service) DeleteUser

func (s *Service) DeleteUser(ctx context.Context, userID int64) error

DeleteUser ...

func (*Service) SignInUser

func (s *Service) SignInUser(ctx context.Context, payload entity.Login) (entity.LoginResponse, error)

SignInUser ...

func (*Service) UpdateUser

func (s *Service) UpdateUser(ctx context.Context, userID int64, payload entity.Signup) error

UpdateUser ...

type UseCase

type UseCase interface {
	GetUser(id int64) (entity.User, error)
	GetUserByEmail(email string) (entity.User, error)
	CreateUser(title string, author string, pages int, quantity int) error
	UpdateUser(user entity.User) error
	DeleteUser(id int64) error
}

UseCase interface

type Writer

type Writer interface {
	Create(ctx context.Context, user *entity.User) error
	Update(ctx context.Context, user *entity.User) error
	Delete(ctx context.Context, user *entity.User) error
}

Writer user writer

Jump to

Keyboard shortcuts

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