Documentation
¶
Index ¶
- type AuthService
- type Authorization
- type Service
- type TodoItem
- type TodoItemService
- func (s *TodoItemService) Create(userId, listId int, item todoappserver.TodoItem) (int, error)
- func (s *TodoItemService) Delete(userId, itemId int) error
- func (s *TodoItemService) GetAll(userId, listId int) ([]todoappserver.TodoItem, error)
- func (s *TodoItemService) GetById(userId, itemId int) (todoappserver.TodoItem, error)
- func (s *TodoItemService) Update(userId, itemId int, input todoappserver.UpdateItemInput) error
- type TodoList
- type TodoListService
- func (s *TodoListService) Create(userId int, list todoappserver.TodoList) (int, error)
- func (s *TodoListService) Delete(userId, listId int) error
- func (s *TodoListService) GetAll(userId int) ([]todoappserver.TodoList, error)
- func (s *TodoListService) GetById(userId, listId int) (todoappserver.TodoList, error)
- func (s *TodoListService) Update(userId, listId int, input todoappserver.UpdateListInput) error
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(repository repository.Authorization) *AuthService
func (*AuthService) CreateUser ¶
func (s *AuthService) CreateUser(user todoappserver.User) (int, error)
func (*AuthService) GenerateToken ¶
func (s *AuthService) GenerateToken(username, password string) (string, error)
func (*AuthService) ParseToken ¶
func (s *AuthService) ParseToken(accessToken string) (int, error)
type Authorization ¶
type Service ¶
type Service struct {
Authorization
TodoList
TodoItem
}
func NewService ¶
func NewService(repository *repository.Repository) *Service
type TodoItem ¶
type TodoItem interface {
Create(userId, listId int, item todoappserver.TodoItem) (int, error)
GetAll(userId, listId int) ([]todoappserver.TodoItem, error)
GetById(userId, itemId int) (todoappserver.TodoItem, error)
Delete(userId, itemId int) error
Update(userId, itemId int, input todoappserver.UpdateItemInput) error
}
type TodoItemService ¶
type TodoItemService struct {
// contains filtered or unexported fields
}
func NewTodoItemService ¶
func NewTodoItemService(repository repository.TodoItem, listRepository repository.TodoList) *TodoItemService
func (*TodoItemService) Create ¶
func (s *TodoItemService) Create(userId, listId int, item todoappserver.TodoItem) (int, error)
func (*TodoItemService) Delete ¶
func (s *TodoItemService) Delete(userId, itemId int) error
func (*TodoItemService) GetAll ¶
func (s *TodoItemService) GetAll(userId, listId int) ([]todoappserver.TodoItem, error)
func (*TodoItemService) GetById ¶
func (s *TodoItemService) GetById(userId, itemId int) (todoappserver.TodoItem, error)
func (*TodoItemService) Update ¶
func (s *TodoItemService) Update(userId, itemId int, input todoappserver.UpdateItemInput) error
type TodoList ¶
type TodoList interface {
Create(userId int, list todoappserver.TodoList) (int, error)
GetAll(userId int) ([]todoappserver.TodoList, error)
GetById(userId, listId int) (todoappserver.TodoList, error)
Delete(userId, listId int) error
Update(userId, listId int, input todoappserver.UpdateListInput) error
}
type TodoListService ¶
type TodoListService struct {
// contains filtered or unexported fields
}
func NewTodoListService ¶
func NewTodoListService(repository repository.TodoList) *TodoListService
func (*TodoListService) Create ¶
func (s *TodoListService) Create(userId int, list todoappserver.TodoList) (int, error)
func (*TodoListService) Delete ¶
func (s *TodoListService) Delete(userId, listId int) error
func (*TodoListService) GetAll ¶
func (s *TodoListService) GetAll(userId int) ([]todoappserver.TodoList, error)
func (*TodoListService) GetById ¶
func (s *TodoListService) GetById(userId, listId int) (todoappserver.TodoList, error)
func (*TodoListService) Update ¶
func (s *TodoListService) Update(userId, listId int, input todoappserver.UpdateListInput) error
Click to show internal directories.
Click to hide internal directories.