Documentation ¶
Overview ¶
Package screen provides building blocks to represent progress bars.
Index ¶
- Variables
- func NewProgressLine(table *TableGenerator, initialLabel string) (*ProgressLine, Segment)
- type AutoRefreshScreen
- type LineSpinnerSegment
- type PagePrint
- type ProgressBarSegment
- type ProgressLine
- type RenderingOptions
- type Segment
- type SimpleScreen
- type StringSegment
- type SwitchSegment
- type TableGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var SpinnerDefaultStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
Functions ¶
func NewProgressLine ¶
func NewProgressLine(table *TableGenerator, initialLabel string) (*ProgressLine, Segment)
Types ¶
type AutoRefreshScreen ¶
type AutoRefreshScreen struct { SimpleScreen // contains filtered or unexported fields }
func NewAutoRefreshScreen ¶
func NewAutoRefreshScreen(options RenderingOptions, bars ...Segment) *AutoRefreshScreen
func (*AutoRefreshScreen) Stop ¶
func (s *AutoRefreshScreen) Stop()
type LineSpinnerSegment ¶
type LineSpinnerSegment struct {
// contains filtered or unexported fields
}
func NewSpinnerSegment ¶
func NewSpinnerSegment() *LineSpinnerSegment
func (*LineSpinnerSegment) Content ¶
func (l *LineSpinnerSegment) Content(options RenderingOptions) string
type ProgressBarSegment ¶
type ProgressBarSegment struct {
// contains filtered or unexported fields
}
func (*ProgressBarSegment) Content ¶
func (p *ProgressBarSegment) Content(options RenderingOptions) string
type ProgressLine ¶
type RenderingOptions ¶
type Segment ¶
type Segment interface {
Content(options RenderingOptions) string
}
func NewConstantSegment ¶
NewConstantSegment creates a constant segment
func NewGreenTickSegment ¶
func NewGreenTickSegment() Segment
func NewProgressBarSegment ¶
func NewSwitchSegment ¶
NewSwitchSegment creates a segment that can switch from one implementation to the other ; returns func to swap that will panic if index out of bound.
func NewUpdatableSegment ¶
NewUpdatableSegment returns the segment and the function to update it
type SimpleScreen ¶
type SimpleScreen struct {
// contains filtered or unexported fields
}
func NewSimpleScreen ¶
func NewSimpleScreen(options RenderingOptions, bars ...Segment) *SimpleScreen
func (*SimpleScreen) ContentHeight ¶
func (s *SimpleScreen) ContentHeight() int
ContentHeight returns number of lines used in content (excluding footer)
func (*SimpleScreen) ForceClear ¶
func (s *SimpleScreen) ForceClear()
ForceClear goes back to the beginning after writing white spaces everywhere
func (*SimpleScreen) Print ¶
func (s *SimpleScreen) Print(page PagePrint)
Print writes given segments in the output ; it doesn't keep the segments and doesn't refresh the page.
func (*SimpleScreen) Refresh ¶
func (s *SimpleScreen) Refresh()
func (*SimpleScreen) TermSize ¶
func (s *SimpleScreen) TermSize() (int, int)
TermSize returns the size of the terminal, in chars
type StringSegment ¶
type StringSegment struct {
// contains filtered or unexported fields
}
func (*StringSegment) Content ¶
func (l *StringSegment) Content(options RenderingOptions) string
type SwitchSegment ¶
type SwitchSegment struct {
// contains filtered or unexported fields
}
func (*SwitchSegment) Content ¶
func (s *SwitchSegment) Content(options RenderingOptions) string
type TableGenerator ¶
type TableGenerator struct {
// contains filtered or unexported fields
}
func NewTable ¶
func NewTable(separator string, widths ...int) *TableGenerator
func (*TableGenerator) NewRow ¶
func (t *TableGenerator) NewRow(delegates ...Segment) Segment
Click to show internal directories.
Click to hide internal directories.