Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOpenAPI3 ¶
NewOpenAPI3 instantiates the OpenAPI specification for this service.
func RegisterOpenAPI ¶
Types ¶
type CreateTasksRequest ¶
type CreateTasksRequest struct { Description string `json:"description"` Priority Priority `json:"priority"` Dates Dates `json:"dates"` }
CreateTasksRequest defines the request used for creating tasks.
type CreateTasksResponse ¶
type CreateTasksResponse struct {
Task Task `json:"task"`
}
CreateTasksResponse defines the response returned back after creating tasks.
type Dates ¶
Dates indicates a point in time where a task starts or completes, dates are not enforced on Tasks.
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` Validations validation.Errors `json:"validations,omitempty"` }
ErrorResponse represents a response containing an error message.
type Priority ¶
type Priority string
Priority indicates how important a Task is.
func NewPriority ¶
NewPriority converts the received domain type to a rest type, when the argument is unknown "none" is used.
type ReadTasksResponse ¶
type ReadTasksResponse struct {
Task Task `json:"task"`
}
ReadTasksResponse defines the response returned back after searching one task.
type SearchTasksRequest ¶
type SearchTasksRequest struct { Description *string `json:"description"` Priority *Priority `json:"priority"` IsDone *bool `json:"is_done"` From int64 `json:"from"` Size int64 `json:"size"` }
SearchTasksRequest defines the request used for searching tasks.
type SearchTasksResponse ¶
SearchTasksResponse defines the response returned back after searching for any task.
type Task ¶
type Task struct { ID string `json:"id"` Description string `json:"description"` Priority Priority `json:"priority"` Dates Dates `json:"dates"` IsDone bool `json:"is_done"` }
Task is an activity that needs to be completed within a period of time.
type TaskHandler ¶
type TaskHandler struct {
// contains filtered or unexported fields
}
TaskHandler ...
func (*TaskHandler) Register ¶
func (t *TaskHandler) Register(r *router.Router)
Register connects the handlers to the router.
type TaskService ¶
type TaskService interface { By(ctx context.Context, args internal.SearchParams) (internal.SearchResults, error) Create(ctx context.Context, params internal.CreateParams) (internal.Task, error) Delete(ctx context.Context, id string) error Task(ctx context.Context, id string) (internal.Task, error) Update(ctx context.Context, id, description string, priority internal.Priority, dates internal.Dates, isDone bool) error }
TaskService ...