Categorygithub.com/julz/prettyprogress
modulepackage
0.0.0-20191213134954-46101f6567ae
Repository: https://github.com/julz/prettyprogress.git
Documentation: pkg.go.dev

# README

prettyprogress

a tiny library for printing nice-looking console progress

GoDoc

Quick Start

See example/multistep/main.go for the main API, or example/simple/main.go for UI-only structs

Features:

  • Nice unicode icons
  • Colors! Animated Bullets!
  • Multiple parallel steps
  • Unicode progress bars with smooth-scrolling (inspired by this blog post)
  • Simple, composable API: just prints itself, use e.g. uilive for animation
  • Basic UI-only package if you just want to print a nice progress bar or grab a pretty unicode icon

Example:

Output from /example/multistep/main.go:

example

# Packages

No description provided by the author
pexec provides a wrapper for exec.Command that prints progress.
Package ui contains some simple structs that have nice-looking String() methods for printing console output with unicode characters.

# Functions

NewBar returns a new Bar object that can be updated, when the UpdateProgress method is called, the passed Watcher is called with the new state.
NewFancyMultistep creates a new updater that prints step progress with fancy colours, bullets and animations using the given Watcher.
NewMultistep creates a new updater that can have multiple sub-steps.
NewStep creates a new Step which can be updated with the status of a single task.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Write creates a Watcher function that writes to a given io.Writer, useful for passing to one of the constructors in this package, e.g.
Writeln creates a Watcher function that writes to a given io.Writer after appending a newline, useful for passing to one of the constructors in this package, e.g.

# Variables

No description provided by the author

# Structs

Bar is an updater that calls its watcher with the String() version of a ui.Bar whenever its UpdateProgress method is called.
No description provided by the author
Step is an updater whose watcher recieves the output of ui.Step's String() method whenever its UpdateStatus method is called.
No description provided by the author

# Type aliases

PrintFunc is a function that is called when new versions of a Bar, Step or Multistep are created as a result of calling UpdateX methods.
No description provided by the author