Documentation
¶
Index ¶
- type TaskTree
- func (tree *TaskTree) AddTask(task task.Task) error
- func (tree *TaskTree) DeleteTask(id task.Id) error
- func (tree *TaskTree) GetAllBlockers(id task.Id) ([]task.Task, error)
- func (tree *TaskTree) GetAncestorTasks(id task.Id) ([]task.Task, error)
- func (tree *TaskTree) GetDirectBlockers(id task.Id) ([]task.Task, error)
- func (tree *TaskTree) GetDirectSubtasksOf(parentId task.Id) ([]task.Task, error)
- func (tree *TaskTree) GetParentTask(id task.Id) (parent task.Task, exists bool, err error)
- func (tree *TaskTree) GetRootTasks() []task.Task
- func (tree *TaskTree) GetTask(id task.Id) (task task.Task, exists bool)
- func (tree *TaskTree) GobDecode(buf []byte) error
- func (tree *TaskTree) GobEncode() ([]byte, error)
- func (tree *TaskTree) IsBlocked(id task.Id) (bool, error)
- func (tree *TaskTree) IsSubtask(id task.Id) (bool, error)
- func (tree *TaskTree) MarkBlocker(blockerId task.Id, blockedId task.Id) error
- func (tree *TaskTree) MarkSubtask(parentId task.Id, subtaskId task.Id) error
- func (tree *TaskTree) UnmarkBlocker(blockerId task.Id, blockedId task.Id) error
- func (tree *TaskTree) UnmarkSubtask(subtaskId task.Id) error
- func (tree *TaskTree) UpdateTask(task task.Task) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskTree ¶
type TaskTree struct {
// contains filtered or unexported fields
}
A TaskTree organizes the relationships between tasks. Thread-safe.
func (*TaskTree) DeleteTask ¶
DeleteTask deletes a task from the tree by id.
func (*TaskTree) GetAllBlockers ¶
GetAllBlockers gets all tasks that either:
- directly block a task
- block a task's ancestors
func (*TaskTree) GetAncestorTasks ¶
GetAncestorTasks returns the ancestors of a task in order (parent task, grandparent task, great grandparent task, etc.)
func (*TaskTree) GetDirectBlockers ¶
GetDirectBlockers gets tasks that are directly blocking the specific task.
func (*TaskTree) GetDirectSubtasksOf ¶
GetDirectSubtasksOf gets the direct children of a Task.
func (*TaskTree) GetParentTask ¶
GetParentTask gets the parent of a given task if it exists.
func (*TaskTree) GetRootTasks ¶
GetRootTasks returns the root tasks (i.e. tasks that aren't subtasks/don't have parents).
func (*TaskTree) GobDecode ¶
GobDecode allows for gob decoding of a TaskTree. A custom implementation is necessary here because the TaskTree struct fields are private.
func (*TaskTree) GobEncode ¶
GobEncode allows for gob encoding of a TaskTree. A custom implementation is necessary here because the TaskTree struct fields are private.
func (*TaskTree) IsSubtask ¶
IsSubtask determines whether a Task is a subtask (i.e. has a parent Task).
func (*TaskTree) MarkBlocker ¶
MarkBlocker marks one task (blocker) as a prerequisite for another task (blocked).
func (*TaskTree) MarkSubtask ¶
MarkSubtask marks one task (subtask) as a subtask of another (parent).
func (*TaskTree) UnmarkBlocker ¶
UnmarkBlocker marks one task (blocker) as a no longer being a prerequisite for another task (blocked).
func (*TaskTree) UnmarkSubtask ¶
UnmarkSubtask marks a task as an independent task rather than a subtask. Does not error if task was already an independent task.