Documentation
¶
Overview ¶
Package switching provides a group that displays modules one at a time, and a controller to switch to the next/previous/specific module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultButtons ¶
func DefaultButtons(c Controller) (start, end bar.Output)
DefaultButtons provides the default switching buttons: - '<' at the start, if there are modules before the current one, - '>' at the end, if there are modules after the current one.
Types ¶
type ButtonFunc ¶
type ButtonFunc func(Controller) (start, end bar.Output)
ButtonFunc produces outputs for buttons in a switching group.
type Controller ¶
type Controller interface { // Current returns the index of the currently active module. Current() int // Previous switches to the previous module. Previous() // Next switches to the next module. Next() // Show sets the currently active module. Show(int) // Count returns the number of modules in this group Count() int // ButtonFunc controls the output for the buttons on either end. ButtonFunc(ButtonFunc) }
Controller provides an interface to control a switching group.
Click to show internal directories.
Click to hide internal directories.