progress

package
v0.0.0-...-5a689ec Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: ISC Imports: 5 Imported by: 0

README

progress

-- import "github.com/MJKWoolnough/gopherjs/progress"

Package progress creates a simple progress bar in javascript

Usage

type Bar
type Bar struct {
	*dom.HTMLCanvasElement
}

Bar is a wrapper around a Canvas element to draw a simple progress bar.

It also implements dom.Node, so it can be Appended to any other node.

func New
func New(fore, back color.Color, width, height int) *Bar

New returns a new Bar

func (*Bar) Percent
func (b *Bar) Percent(i int)

Percent sets the current percentage shown

func (*Bar) Reader
func (b *Bar) Reader(r io.Reader, size int) *Reader

Reader returns a Reader type

type Reader
type Reader struct {
	*Bar
	io.Reader
}

Reader wraps a ProgressBar to automatically update when an io.Reader is read

func (*Reader) Len
func (r *Reader) Len() int

Len returns the total length of the data

func (*Reader) Read
func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader

Documentation

Overview

Package progress creates a simple progress bar in javascript

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar struct {
	*dom.HTMLCanvasElement
	// contains filtered or unexported fields
}

Bar is a wrapper around a Canvas element to draw a simple progress bar.

It also implements dom.Node, so it can be Appended to any other node.

func New

func New(fore, back color.Color, width, height int) *Bar

New returns a new Bar

func (*Bar) Percent

func (b *Bar) Percent(i int)

Percent sets the current percentage shown

func (*Bar) Reader

func (b *Bar) Reader(r io.Reader, size int) *Reader

Reader returns a Reader type

type Reader

type Reader struct {
	*Bar
	io.Reader
	// contains filtered or unexported fields
}

Reader wraps a ProgressBar to automatically update when an io.Reader is read

func (*Reader) Len

func (r *Reader) Len() int

Len returns the total length of the data

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader

Jump to

Keyboard shortcuts

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