Documentation
¶
Index ¶
- Variables
- type CreateTask
- type Handler
- func (h *Handler) DeleteTasksId(w http.ResponseWriter, r *http.Request, id int)
- func (h *Handler) GetTasks(w http.ResponseWriter, r *http.Request, params timetrackapi.GetTasksParams)
- func (h *Handler) GetTasksId(w http.ResponseWriter, r *http.Request, id int)
- func (h *Handler) PatchTasksId(w http.ResponseWriter, r *http.Request, id int)
- func (h *Handler) PostTasks(w http.ResponseWriter, r *http.Request)
- type Service
- type ServiceImpl
- func (s *ServiceImpl) Create(ctx context.Context, create *CreateTask) (*Task, error)
- func (s *ServiceImpl) Delete(ctx context.Context, id int) (*Task, error)
- func (s *ServiceImpl) Get(ctx context.Context, id int) (*Task, error)
- func (s *ServiceImpl) List(ctx context.Context, offset, limit int) ([]Task, error)
- func (s *ServiceImpl) Update(ctx context.Context, id int, update *UpdateTask) (*Task, error)
- type Task
- type UpdateTask
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("task not found")
)
Functions ¶
This section is empty.
Types ¶
type CreateTask ¶
type CreateTask struct {
Description string
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) DeleteTasksId ¶
DeleteTasksId handles "DELETE /tasks/{id}".
For simplicity, we don't use user in the task domain, but we do use them in other domains.
func (*Handler) GetTasks ¶
func (h *Handler) GetTasks(w http.ResponseWriter, r *http.Request, params timetrackapi.GetTasksParams)
GetTasks handles "GET /tasks/".
For simplicity, we don't use user in the task domain, but we do use them in other domains.
func (*Handler) GetTasksId ¶
GetTasksId handles "GET /tasks/{id}".
For simplicity, we don't use user in the task domain, but we do use them in other domains.
func (*Handler) PatchTasksId ¶
PatchTasksId handles "PATCH /tasks/{id}".
For simplicity, we don't use user in the task domain, but we do use them in other domains.
type Service ¶
type Service interface { Create(ctx context.Context, create *CreateTask) (*Task, error) Get(ctx context.Context, id int) (*Task, error) List(ctx context.Context, offset, limit int) ([]Task, error) Update(ctx context.Context, id int, update *UpdateTask) (*Task, error) Delete(ctx context.Context, id int) (*Task, error) }
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
func NewServiceImpl ¶
func NewServiceImpl(db database.DB) *ServiceImpl
func (*ServiceImpl) Create ¶
func (s *ServiceImpl) Create(ctx context.Context, create *CreateTask) (*Task, error)
func (*ServiceImpl) Update ¶
func (s *ServiceImpl) Update(ctx context.Context, id int, update *UpdateTask) (*Task, error)
type UpdateTask ¶
type UpdateTask struct {
Description *string
}
Click to show internal directories.
Click to hide internal directories.