Versions in this module Expand all Collapse all v0 v0.1.0 May 11, 2022 Changes in this version + type AuthService struct + func NewAuthService(storage AuthStorage) *AuthService + func (s *AuthService) CreateUser(u core.User) (core.User, error) + func (s *AuthService) GenerateToken(uname, pwd string) (string, error) + func (s *AuthService) ParseToken(accessToken string) (int, error) + type AuthStorage interface + CreateUser func(core.User) (core.User, error) + GetUser func(username, password string) (core.User, error) + type Deps struct + AuthStorage AuthStorage + TodoItemStorage TodoItemStorage + TodoListStorage TodoListStorage + type Service struct + Auth *AuthService + TodoItem *TodoItemService + TodoList *TodoListService + func NewService(deps Deps) *Service + type TodoItemService struct + func NewTodoItemService(storage TodoItemStorage) *TodoItemService + func (s *TodoItemService) CreateTodo(listID int, todo core.TodoItem) (core.TodoItem, error) + func (s *TodoItemService) DeleteTodo(todoID int) error + func (s *TodoItemService) GetAllTodos(listID int) ([]core.TodoItem, error) + func (s *TodoItemService) GetTodoByID(listID, todoID int) (core.TodoItem, error) + func (s *TodoItemService) UpdateTodo(todoID int, data core.UpdateItemData) (core.TodoItem, error) + type TodoItemStorage interface + CreateTodo func(listID int, todo core.TodoItem) (core.TodoItem, error) + DeleteTodo func(todoID int) error + GetAllTodos func(listID int) ([]core.TodoItem, error) + GetTodoByID func(listID, todoID int) (core.TodoItem, error) + UpdateTodo func(todoID int, data core.UpdateItemData) (core.TodoItem, error) + type TodoListService struct + func NewTodoListService(storage TodoListStorage) *TodoListService + func (s *TodoListService) CreateList(userID int, list core.Todolist) (core.Todolist, error) + func (s *TodoListService) DeleteList(listID int) error + func (s *TodoListService) GetAllLists(userID int) ([]core.Todolist, error) + func (s *TodoListService) GetListByID(userID, listID int) (core.Todolist, error) + func (s *TodoListService) UpdateList(listID int, data core.UpdateListData) (core.Todolist, error) + type TodoListStorage interface + CreateList func(userID int, list core.Todolist) (core.Todolist, error) + DeleteList func(listID int) error + GetAllLists func(userID int) ([]core.Todolist, error) + GetListByID func(userID, listID int) (core.Todolist, error) + UpdateList func(listID int, data core.UpdateListData) (core.Todolist, error) + type TokenClaims struct + UserID int