service

package
v0.0.0-...-f068abf Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("already exists")
	ErrNotFound      = errors.New("not found")
)

Functions

func NewTodoService

func NewTodoService(
	logger log.Logger,
	dbRW repository.DatabaseReaderWriter,
	cacheRW repository.CacheReaderWriter,
) *todoService

Types

type Middleware

type Middleware func(TodoService) TodoService

func NewMiddleware

func NewMiddleware(logger log.Logger) Middleware

type TodoService

type TodoService interface {
	GetAllTodo(ctx context.Context, req entity.GetAllTodoRequest) ([]entity.Todo, error)
	GetTodoByID(ctx context.Context, req entity.GetTodoByIDRequest) (entity.Todo, error)

	CreateTodo(ctx context.Context, req entity.CreateTodoRequest) error
	UpdateTodo(ctx context.Context, req entity.UpdateTodoRequest) error
	DeleteTodo(ctx context.Context, req entity.DeleteTodoRequest) error
}

Jump to

Keyboard shortcuts

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