progress

package
v0.0.0-...-2de43c5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package progress provides progress bars and progress reporting

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeChan

func MakeChan() chan *ProgressMsg

Types

type Event

type Event uint
const (
	BeforeStart Event = iota
	Start
	Update
	Finished
	Error
	AllDone
	Cancelled
)

type ProgressMsg

type ProgressMsg struct {
	Event   Event
	Message string
	Error   error
	Payload interface{}
}

type ScanBar

type ScanBar struct {
	Visited uint64
	Found   uint64
	Wanted  uint64
	Max     uint64
	Freq    uint64
	WidPct  float64
}

func NewScanBar

func NewScanBar(want, freq, max uint64, widPct float64) *ScanBar

func (*ScanBar) Pct

func (v *ScanBar) Pct() float64

func (*ScanBar) Report

func (v *ScanBar) Report(writer io.Writer, action, msg string)

func (*ScanBar) Satisfied

func (v *ScanBar) Satisfied() bool

Jump to

Keyboard shortcuts

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