progress

package module
v0.0.0-...-9914e42 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 0 Imported by: 1

README

go.simple-progressbar

  • 安装

    go get -u gitee.com/zinface/go.simple-progressbar
    
  • 基本用法

    import progressbar "gitee.com/zinface/go.simple-progressbar"
    
    var pv = progressbar.NewSimpleProgress(progressbar.SimpleColorValue)
    for i := 0; i < 100; i++ {
    	fmt.Printf("%s ", pv.NextValue())
    	fmt.Printf("%d%%\r", i)
    	time.Sleep(40 * time.Millisecond)
    }
    

    看起来像:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Progress

type Progress interface {
	Type() ProgressType
	Next()
	Value() interface{}
	Percent() int
}

Progress

type ProgressType

type ProgressType int
const (
	OnlyValue ProgressType = iota
)

type SimpleProgress

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

func NewSimpleProgress

func NewSimpleProgress(values []string) *SimpleProgress

func (*SimpleProgress) Next

func (p *SimpleProgress) Next()

func (*SimpleProgress) NextValue

func (p *SimpleProgress) NextValue() string

func (*SimpleProgress) Value

func (p *SimpleProgress) Value() string

type SimpleSimpleProgress

type SimpleSimpleProgress []string
var (
	SimpleColorValue SimpleSimpleProgress = []string{
		"\033[36m[/]\033[m",
		"\033[36m[-]\033[m",
		"\033[36m[\\]\033[m",
		"\033[36m[|]\033[m",
	}
	SimpleSpinnerValue = []string{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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