progressformatter

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package progressformatter is an implementation based on github.com/wagoodman/go-progress/simple

Index

Constants

This section is empty.

Variables

View Source
var DefaultTheme = Theme{
	Filled:         color.HEX("#fcba03").Sprintf(">"),
	Empty:          color.HEX("#777777").Sprintf(">"),
	StartDelimiter: color.HEX("#777777").Sprintf("["),
	EndDelimiter:   color.HEX("#777777").Sprintf("]"),
}

DefaultTheme is the default theme for progress formatter.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter is the formatter of progress bar.

func NewFormatter

func NewFormatter(width int) *Formatter

NewFormatter will initialize a formatter with the default theme.

func NewFormatterWithTheme

func NewFormatterWithTheme(width int, theme Theme) *Formatter

NewFormatterWithTheme will initialize a formatter with a specific theme.

func (*Formatter) Format

func (f *Formatter) Format(p progress.Progress) string

Format will format the bar with progress.

type Theme

type Theme struct {
	Filled         string
	Empty          string
	StartDelimiter string
	EndDelimiter   string
}

Theme is the theme of the progress bar.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL