Documentation
¶
Overview ¶
Package core provides some of the basic barista functionality, enabling more complex constructs without duplicating code or logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a bar.Module wrapped with core barista functionality. It is used as a building block for the main bar, modules that manipulate other modules (group, reformat), and for writing tests. It handles restarting the wrapped module on a left/right/middle click, as well as providing an option to "replay" the last output from the module. It also provides timed output functionality.
func NewModule ¶
NewModule wraps an existing bar.Module with core barista functionality, such as restarts and the ability to replay the last output.
type ModuleSet ¶
type ModuleSet struct {
// contains filtered or unexported fields
}
ModuleSet is a group of modules. It provides a channel for identifying module updates, and methods to get the last output of the set or a specific module.
func NewModuleSet ¶
NewModuleSet creates a ModuleSet with the given modules.
func (*ModuleSet) LastOutput ¶
LastOutput returns the last output from the module at a specific position. If the module has not yet updated, an empty output will be used.
func (*ModuleSet) LastOutputs ¶
LastOutputs returns the last output from all modules in order. The returned slice will have exactly Len() elements, and if a module has not yet updated an empty output will be placed in its position.
func (*ModuleSet) Len ¶
Len returns the number of modules in this ModuleSet.