Documentation
¶
Overview ¶
Package composite implements the Composite design pattern. It models classic Agile concepts such as Epics, Tasks, and SubTasks. SubTasks are leaf nodes, while Epics and Tasks are composites that can contain other components—either leaf nodes or nested composites. All components implement a shared set of interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Composer ¶
type Composer interface {
AddChild(DetailsPresenter) Composer
}
Composer is implemented by composite components only that can contain child components.
type DetailsPresenter ¶
type DetailsPresenter interface {
ShowDetails() string
}
DetailsPresenter defines behavior for displaying component details, including nested ones.
type Epic ¶
type Epic struct {
WorkItem
Children []DetailsPresenter
}
Epic represents the composite component.
func (*Epic) AddChild ¶
func (e *Epic) AddChild(child DetailsPresenter) Composer
AddChild allows to add the children to the composite
func (*Epic) NextStatus ¶
func (e *Epic) NextStatus() StatusManager
NextStatus updates the status of the component to the next step in the pipeline.
func (*Epic) ShowDetails ¶
ShowDetails returns the aggregated details of the component and its sub-components.
type StatusManager ¶
type StatusManager interface {
GetStatus() string
NextStatus() StatusManager
}
StatusManager defines behavior for retrieving and updating the workflow status of a component.
type SubTask ¶
type SubTask struct {
WorkItem
}
SubTask represents the leaf component.
func (*SubTask) NextStatus ¶
func (st *SubTask) NextStatus() StatusManager
NextStatus updates the status of the component to the next step in the pipeline.
func (*SubTask) ShowDetails ¶
ShowDetails returns the details of the component.
type Task ¶
type Task struct {
WorkItem
Children []DetailsPresenter
}
Task represents the composite component.
func (*Task) AddChild ¶
func (t *Task) AddChild(child DetailsPresenter) Composer
AddChild allows to add the children to the composite
func (*Task) NextStatus ¶
func (t *Task) NextStatus() StatusManager
NextStatus updates the status of the component to the next step in the pipeline.
func (*Task) ShowDetails ¶
ShowDetails returns the aggregated details of the component and its sub-components.