Documentation ¶
Index ¶
- type AuthService
- type AuthStorage
- type Deps
- type Service
- type 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
- type 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
- type TokenClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(storage AuthStorage) *AuthService
func (*AuthService) CreateUser ¶
func (*AuthService) GenerateToken ¶
func (s *AuthService) GenerateToken(uname, pwd string) (string, error)
func (*AuthService) ParseToken ¶
func (s *AuthService) ParseToken(accessToken string) (int, error)
type AuthStorage ¶
type Deps ¶
type Deps struct { AuthStorage AuthStorage TodoListStorage TodoListStorage TodoItemStorage TodoItemStorage }
type Service ¶
type Service struct { Auth *AuthService TodoList *TodoListService TodoItem *TodoItemService }
func NewService ¶
type TodoItemService ¶
type TodoItemService struct {
// contains filtered or unexported fields
}
func NewTodoItemService ¶
func NewTodoItemService(storage TodoItemStorage) *TodoItemService
func (*TodoItemService) CreateTodo ¶
func (*TodoItemService) DeleteTodo ¶
func (s *TodoItemService) DeleteTodo(todoID int) error
func (*TodoItemService) GetAllTodos ¶
func (s *TodoItemService) GetAllTodos(listID int) ([]core.TodoItem, error)
func (*TodoItemService) GetTodoByID ¶
func (s *TodoItemService) GetTodoByID(listID, todoID int) (core.TodoItem, error)
func (*TodoItemService) UpdateTodo ¶
func (s *TodoItemService) UpdateTodo(todoID int, data core.UpdateItemData) (core.TodoItem, error)
type TodoItemStorage ¶
type TodoItemStorage interface { CreateTodo(listID int, todo core.TodoItem) (core.TodoItem, error) GetAllTodos(listID int) ([]core.TodoItem, error) GetTodoByID(listID, todoID int) (core.TodoItem, error) UpdateTodo(todoID int, data core.UpdateItemData) (core.TodoItem, error) DeleteTodo(todoID int) error }
type TodoListService ¶
type TodoListService struct {
// contains filtered or unexported fields
}
func NewTodoListService ¶
func NewTodoListService(storage TodoListStorage) *TodoListService
func (*TodoListService) CreateList ¶
func (*TodoListService) DeleteList ¶
func (s *TodoListService) DeleteList(listID int) error
func (*TodoListService) GetAllLists ¶
func (s *TodoListService) GetAllLists(userID int) ([]core.Todolist, error)
func (*TodoListService) GetListByID ¶
func (s *TodoListService) GetListByID(userID, listID int) (core.Todolist, error)
func (*TodoListService) UpdateList ¶
func (s *TodoListService) UpdateList(listID int, data core.UpdateListData) (core.Todolist, error)
type TodoListStorage ¶
type TodoListStorage interface { CreateList(userID int, list core.Todolist) (core.Todolist, error) GetAllLists(userID int) ([]core.Todolist, error) GetListByID(userID, listID int) (core.Todolist, error) UpdateList(listID int, data core.UpdateListData) (core.Todolist, error) DeleteList(listID int) error }
type TokenClaims ¶
type TokenClaims struct { jwt.RegisteredClaims UserID int `json:"user_id"` }
Click to show internal directories.
Click to hide internal directories.