Documentation ¶
Index ¶
Constants ¶
View Source
const ( TaskStatusPending = "pending" TaskStatusDone = "done" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryTasksDB ¶
type InMemoryTasksDB struct {
// contains filtered or unexported fields
}
func NewInMemoryTasksDB ¶
func NewInMemoryTasksDB() *InMemoryTasksDB
func (*InMemoryTasksDB) AddTask ¶
func (db *InMemoryTasksDB) AddTask(task Task) error
func (*InMemoryTasksDB) DeleteTask ¶
func (db *InMemoryTasksDB) DeleteTask(id string) error
func (*InMemoryTasksDB) GetTasks ¶
func (db *InMemoryTasksDB) GetTasks(ownerID string) ([]Task, error)
func (*InMemoryTasksDB) UpdateTask ¶
func (db *InMemoryTasksDB) UpdateTask(task Task) error
type Task ¶
type Task struct { ID string OwnerID string Title string Description string Status string DeletedAt time.Time DeletedBy string }
func DeserializeTask ¶
type TaskDeletionResponse ¶
type TaskResponse ¶
type TaskResponse struct { ID string `json:"id"` OwnerID string `json:"ownerId"` Title string `json:"title"` Description string `json:"description"` Status string `json:"status"` // Fields that will not be serialized as json DeletedAt time.Time DeletedBy string }
func NewTaskResponse ¶
func NewTaskResponse(task Task) TaskResponse
type TasksDataSource ¶
type TasksHandler ¶
type TasksHandler struct {
// contains filtered or unexported fields
}
func NewTasksHandler ¶
func NewTasksHandler(ds TasksDataSource) *TasksHandler
func (*TasksHandler) DeleteTask ¶
func (h *TasksHandler) DeleteTask(c *gin.Context) error
func (*TasksHandler) UndoDeletion ¶
func (h *TasksHandler) UndoDeletion(c *gin.Context) error
Click to show internal directories.
Click to hide internal directories.