Documentation
¶
Index ¶
- func NewPostgresDB(config Config) (*sqlx.DB, error)
- type AuthPostgres
- type Authorization
- type Config
- type Repository
- type TodoItem
- type TodoItemPostgres
- func (r *TodoItemPostgres) Create(listId int, item todo.TodoItem) (int, error)
- func (r *TodoItemPostgres) Delete(userId, itemId int) error
- func (r *TodoItemPostgres) GetAll(userId, listId int) ([]todo.TodoItem, error)
- func (r *TodoItemPostgres) GetById(userId, itemId int) (todo.TodoItem, error)
- func (r *TodoItemPostgres) Update(userId, itemId int, input todo.UpdateItemInput) error
- type TodoList
- type TodoListPostgres
- func (r TodoListPostgres) Create(userId int, list todo.TodoList) (int, error)
- func (r TodoListPostgres) Delete(userId, listId int) error
- func (r TodoListPostgres) FindAll(userId int) ([]todo.TodoList, error)
- func (r TodoListPostgres) FindById(userId, id int) (todo.TodoList, error)
- func (r TodoListPostgres) Update(userId, listId int, updateListRequest todo.UpdateTodoListRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthPostgres ¶
type AuthPostgres struct {
// contains filtered or unexported fields
}
func NewAuthPostgres ¶
func NewAuthPostgres(db *sqlx.DB) *AuthPostgres
NewAuthPostgres creates a new AuthPostgres
func (AuthPostgres) CreateUser ¶
func (r AuthPostgres) CreateUser(user todo.User) (int, error)
CreateUser saves a new user in Post
type Authorization ¶
type Repository ¶
type Repository struct { Authorization TodoList TodoItem }
type TodoItemPostgres ¶
type TodoItemPostgres struct {
// contains filtered or unexported fields
}
func NewTodoItemPostgres ¶
func NewTodoItemPostgres(db *sqlx.DB) *TodoItemPostgres
func (*TodoItemPostgres) Create ¶
func (r *TodoItemPostgres) Create(listId int, item todo.TodoItem) (int, error)
func (*TodoItemPostgres) Delete ¶
func (r *TodoItemPostgres) Delete(userId, itemId int) error
func (*TodoItemPostgres) GetAll ¶
func (r *TodoItemPostgres) GetAll(userId, listId int) ([]todo.TodoItem, error)
func (*TodoItemPostgres) GetById ¶
func (r *TodoItemPostgres) GetById(userId, itemId int) (todo.TodoItem, error)
func (*TodoItemPostgres) Update ¶
func (r *TodoItemPostgres) Update(userId, itemId int, input todo.UpdateItemInput) error
type TodoListPostgres ¶
type TodoListPostgres struct {
// contains filtered or unexported fields
}
func NewTodoListPostgres ¶
func NewTodoListPostgres(db *sqlx.DB) *TodoListPostgres
func (TodoListPostgres) Create ¶
func (r TodoListPostgres) Create(userId int, list todo.TodoList) (int, error)
func (TodoListPostgres) Delete ¶
func (r TodoListPostgres) Delete(userId, listId int) error
Delete deletes Todolist for specified user
func (TodoListPostgres) FindAll ¶
func (r TodoListPostgres) FindAll(userId int) ([]todo.TodoList, error)
FindAll finds all TodoList for specified userId
func (TodoListPostgres) FindById ¶
func (r TodoListPostgres) FindById(userId, id int) (todo.TodoList, error)
FindById finds TodoList by specified listId
func (TodoListPostgres) Update ¶
func (r TodoListPostgres) Update(userId, listId int, updateListRequest todo.UpdateTodoListRequest) error
Update updates the specified TodoList
Click to show internal directories.
Click to hide internal directories.