progressreader

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	In         io.ReadCloser // Stream to read from
	Out        io.Writer     // Where to send progress bar to
	Formatter  StreamFormatter
	Size       int
	Current    int
	LastUpdate int
	NewLines   bool
	ID         string
	Action     string
}

Reader with progress bar

func New

func New(newReader Config) *Config

func (*Config) Close

func (config *Config) Close() error

func (*Config) Read

func (config *Config) Read(p []byte) (n int, err error)

type JSONProg

type JSONProg struct {
	Current int
	Total   int
}

func (*JSONProg) GetCurrent

func (j *JSONProg) GetCurrent() int

func (*JSONProg) GetTotal

func (j *JSONProg) GetTotal() int

type PR_JSONProgress

type PR_JSONProgress interface {
	GetCurrent() int
	GetTotal() int
}

type StreamFormatter

type StreamFormatter interface {
	FormatProg(string, string, interface{}) []byte
	FormatStatus(string, string, ...interface{}) []byte
	FormatError(error) []byte
}

Jump to

Keyboard shortcuts

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