progress

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package progress provides common progress monitoring / display features NOTE: Subject to change, do not rely on this package from outside git-lfs source

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackReader

type CallbackReader struct {
	C         CopyCallback
	TotalSize int64
	ReadSize  int64
	io.Reader
}

func (*CallbackReader) Read

func (w *CallbackReader) Read(p []byte) (int, error)

type CopyCallback

type CopyCallback func(totalSize int64, readSoFar int64, readSinceLast int) error

type ProgressMeter

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

ProgressMeter provides a progress bar type output for the TransferQueue. It is given an estimated file count and size up front and tracks the number of files and bytes transferred as well as the number of files and bytes that get skipped because the transfer is unnecessary.

func NewProgressMeter

func NewProgressMeter(estFiles int, estBytes int64, dryRun bool, logPath string) *ProgressMeter

NewProgressMeter creates a new ProgressMeter for the number and size of files given.

func (*ProgressMeter) Add

func (p *ProgressMeter) Add(name string)

Add tells the progress meter that a transferring file is being added to the TransferQueue.

func (*ProgressMeter) Finish

func (p *ProgressMeter) Finish()

Finish shuts down the ProgressMeter

func (*ProgressMeter) FinishTransfer

func (p *ProgressMeter) FinishTransfer(name string)

FinishTransfer increments the finished transfer count

func (*ProgressMeter) Skip

func (p *ProgressMeter) Skip(size int64)

Skip tells the progress meter that a file of size `size` is being skipped because the transfer is unnecessary.

func (*ProgressMeter) Start

func (p *ProgressMeter) Start()

func (*ProgressMeter) TransferBytes

func (p *ProgressMeter) TransferBytes(direction, name string, read, total int64, current int)

TransferBytes increments the number of bytes transferred

type Spinner

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

Indeterminate progress indicator 'spinner'

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Finish

func (s *Spinner) Finish(out io.Writer, finishMsg string)

Finish the spinner with a completion message & newline

func (*Spinner) Print

func (s *Spinner) Print(out io.Writer, msg string)

Print a spinner (stage) to out followed by msg (no linefeed)

func (*Spinner) Spin

func (s *Spinner) Spin(out io.Writer)

Just spin the spinner one more notch & use the last message

Jump to

Keyboard shortcuts

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