-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
badfb99
commit a60692d
Showing
14 changed files
with
122 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package events | ||
|
||
// ============================================================================ | ||
// DELETE BY ID | ||
// ============================================================================ | ||
// NewErrorEvent will create a new event that is used to report an error | ||
func NewErrorEvent(error error) *Event { | ||
return &Event{ | ||
Type: EventError, | ||
Data: error, | ||
} | ||
} | ||
|
||
// DecodeErrorEvent will decode the event to report an error | ||
func DecodeErrorEvent(e *Event) error { return e.Data.(error) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
package events | ||
|
||
type EventType string | ||
type EventType string // EventType is a type of event | ||
|
||
const ( | ||
EventError EventType = "Error" | ||
EventRunProgram EventType = "RunProgram" | ||
EventListTasks EventType = "ListTasks" | ||
EventCompleteTaskById EventType = "CompleteTaskByID" | ||
EventTableFuzzySearch EventType = "TableFuzzySearch" | ||
EventDeleteTaskById EventType = "DeleteTaskByID" | ||
EventStartTaskById EventType = "StartTask" | ||
EventStopTaskById EventType = "StopTask" | ||
EventListTaskResponse EventType = "ListTaskResponse" | ||
EventIncreasePriority EventType = "IncreaseTaskPriority" | ||
EventDecreasePriority EventType = "DecreaseTaskPriority" | ||
EventSetPriority EventType = "SetTaskPriority" | ||
EventError EventType = "Error" // Error event | ||
EventRunProgram EventType = "RunProgram" // RunProgram e.g 'add task' | ||
EventListTasks EventType = "ListTasks" // ListTasks event | ||
EventCompleteTaskById EventType = "CompleteTaskByID" // Mark a task as complete | ||
EventTableFuzzySearch EventType = "TableFuzzySearch" // Fuzzy search for a task | ||
EventDeleteTaskById EventType = "DeleteTaskByID" // Delete a task | ||
EventStartTaskById EventType = "StartTask" // Start a task | ||
EventStopTaskById EventType = "StopTask" // Stop a task | ||
EventListTaskResponse EventType = "ListTaskResponse" // List tasks responses to be consumed by the UI | ||
EventIncreasePriority EventType = "IncreaseTaskPriority" // Increase the priority of a task | ||
EventDecreasePriority EventType = "DecreaseTaskPriority" // Decrease the priority of a task | ||
EventSetPriority EventType = "SetTaskPriority" // Set the priority of a task | ||
) | ||
|
||
type Event struct { | ||
Type EventType | ||
Data interface{} | ||
Type EventType // Type of event | ||
Data interface{} // Data associated with the event (payload) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.