Documentation ¶
Index ¶
- Constants
- type Error
- type ToDoItem
- type ToDoService
- func (u *ToDoService) Create(ctx context.Context, usr *ToDoItem) error
- func (u *ToDoService) Delete(ctx context.Context, id string) error
- func (u *ToDoService) List(ctx context.Context) ([]ToDoItem, error)
- func (u *ToDoService) Update(ctx context.Context, updatedUsr *ToDoItem, mask_paths []string) error
- type ToDoStorage
Constants ¶
View Source
const ( // ErrToDoItemNotFound when todo item is not found. ErrToDoItemNotFound = Error("todo item not found") // ErrToDoItemAlreadyExist when todo item already exist in the system. ErrToDoItemAlreadyExist = Error("todo item already exists") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ToDoService ¶
type ToDoService struct {
// contains filtered or unexported fields
}
ToDoService represent the service that manage todo without implementation detail, this aim to provide API that will be exposed to the handler (HTTP, GRPC)
func (*ToDoService) Create ¶
func (u *ToDoService) Create(ctx context.Context, usr *ToDoItem) error
Create creates a new todo. If the todo already exist in the storage, ErrToDoItemAlreadyExist will be returned.
func (*ToDoService) Delete ¶
func (u *ToDoService) Delete(ctx context.Context, id string) error
Delete deletes the todo form the todo storage.
Click to show internal directories.
Click to hide internal directories.