user

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

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 3 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(id int64) (*entity.User, error)
	Search(query string) ([]*entity.User, error)
	List() ([]*entity.User, error)
}

Reader interface

type Repository

type Repository interface {
	Reader
	Writer
}

Repository interface

type Service

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

Service interface

func NewService

func NewService(r Repository) *Service

NewService create new use case

func (*Service) ConsumeRegister

func (s *Service) ConsumeRegister(body []byte) error

Consume register user

func (*Service) GetUser

func (s *Service) GetUser(id int64) (*entity.User, error)

GetUser Get an user

func (*Service) ListUsers

func (s *Service) ListUsers() ([]*entity.User, error)

ListUsers List users

func (*Service) Register

func (s *Service) Register(email, password, username string) (int64, error)

Register register an user

func (*Service) SearchUsers

func (s *Service) SearchUsers(query string) ([]*entity.User, error)

SearchUsers Search users

type UseCase

type UseCase interface {
	GetUser(id int64) (*entity.User, error)
	SearchUsers(query string) ([]*entity.User, error)
	ListUsers() ([]*entity.User, error)
	Register(email, password, username string) (int64, error)
	ConsumeRegister(body []byte) error
}

UseCase interface

type Writer

type Writer interface {
	Create(e *entity.User) (int64, error)
	Update(e *entity.User) error
	Delete(id int64) error
}

Writer user writer

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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