Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SetDoneEvent : setting status from (not_done, closed) -> done SetDoneEvent ChangeStatusEvent = "set done" // CloseEvent : setting status from (not_done, done) -> closed CloseEvent ChangeStatusEvent = "close" // ReopenEvent : setting status from (closed, done) -> not_done ReopenEvent ChangeStatusEvent = "reopen" // LeaveUnchangedEvent : leaving status the same as it was LeaveUnchangedEvent ChangeStatusEvent = "leave unchanged" // UndefinedFromErrorMessage is `undefined 'from' status“ UndefinedFromErrorMessage = "undefined 'from' status" // UndefinedToErrorMessage is `undefined 'to' status` UndefinedToErrorMessage = "undefined 'to' status" // UnsupportedStatusChangeErrorMessage is `unsupported status change from %s to %s` UnsupportedStatusChangeErrorMessage = "unsupported status change from %s to %s" // ClosingWithoutReasonErrorMessage is `trying to close task without reason` ClosingWithoutReasonErrorMessage = "trying to close task without reason" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeStatusEvent ¶
type ChangeStatusEvent string
ChangeStatusEvent represents update action on task status (set from one state to another)
func NewChangeStatusEvent ¶
func NewChangeStatusEvent(from, to api.Status, reason string) (ChangeStatusEvent, error)
NewChangeStatusEvent creates new ChangeStatusEvent from request fields
type Page ¶
Page represents a GET request page
func (*Page) ToLimitOffset ¶
ToLimitOffset represents limit + offset to be selected with from the db
type Task ¶
type Task struct { ID int64 `db:"id"` Title string `db:"title"` Term Term `db:"term"` IsGreen bool `db:"is_greeen"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` ClosedAt *time.Time `db:"created_at"` ClosedReason string `db:"closed_reason"` IsArchived bool `db:"is_archived"` }
Task represents task entity
func NewTaskFromRequest ¶
func NewTaskFromRequest(request *TaskRequest) *Task
NewTaskFromRequest creates new Task from the request
type TaskRequest ¶
type TaskRequest struct { Title string `db:"title"` Term Term `db:"term"` IsGreen bool `db:"is_greeen"` }
TaskRequest represents request for creating the task
func NewTaskRequest ¶
func NewTaskRequest(request *api.AddTaskRequest) (*TaskRequest, error)
NewTaskRequest constructs new TaskRequest
type Term ¶
Term is a wrapper around Term Enum
func NewTermFromInt ¶
NewTermFromInt constructs new Term
func NewTermFromString ¶
NewTermFromString constructs new Term
Click to show internal directories.
Click to hide internal directories.