Documentation
¶
Overview ¶
Package collector collects output lines grouped by id and provides ways to retrieve and merge output ordered by the time each line was added.
Index ¶
- type Output
- func (o *Output) Append(text string)
- func (o *Output) AppendToID(id int, text string)
- func (o *Output) Clear(id int)
- func (o *Output) Contains(id int) bool
- func (o *Output) Get(id int) []string
- func (o *Output) GetAll(ids ...int) []string
- func (o *Output) Merge(fromID, intoID int)
- func (o *Output) SetActiveID(id int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output stores output lines grouped by id. Output can be retrieved for one or more ids and output for different ids can be merged together, while preserving their insertion original order based on the time it was collected. Output also tracks the active id, so you can append output without providing an id.
func (*Output) Append ¶
Append appends the given line of text to the output of the currently active id.
func (*Output) AppendToID ¶
AppendToID appends the given line of text to the output of the given id.
func (*Output) Contains ¶
Contains returns true if any output lines were collected for the given id.
func (*Output) GetAll ¶
GetAll returns the output lines for all ids sorted by the collection timestamp of each line of output.
func (*Output) Merge ¶
Merge merges the output lines from fromID into intoID, and sorts the output by the collection timestamp of each line of output.
func (*Output) SetActiveID ¶
SetActiveID sets the active id. Text appended to this output will be associated with the active id.