Termloader
Termloader is a simple library to add a loading screen to your terminal applications. Termloader will render the loader at the center of your terminal screen. Currently termloader is supported only on *nix operating systems.
Installation
go get github.com/bharath-srinivas/termloaderExample Usage
package main
import (
"time"
"github.com/bharath-srinivas/termloader"
)
func main() {
loader := termloader.New(termloader.CharsetConfigs["default"]) // construct a new loader with config
loader.Start() // start the loader
time.Sleep(5 * time.Second) // sleep for sometime to simulate a task
loader.Stop() // stop the loader
}Loader color
loader.Color = termloader.Green // provide a color for the loader (white if not provided)Provide a loading text
loader.Text = "Loading" // provide a text to show above the loaderLoading text color
loadingText := termloader.ColorString("Now Loading", termloader.Green) // color the string
loader.Text = loadingText // provide the colored string as loading textCustom delay
loader.Delay = 100 * time.Millisecond // delay in millisecondsLoading image
Termloader supports only jpeg and png formats as of now. Support for more formats might be added later.
loader.Image.SetPath("/path/to/image") // provide the path of the loading image
loader.Image.SetWidth(55) // set custom width for the image
loader.Image.SetHeight(15) // set custom height for the image
loader.Image.Sharpen(6.5) // sharpens the imageProvide your own character set for loader
charsetConfig := termloader.CharsetConfig{Charset: []string{"|", "/", "-", "\\"}, Delay: 100 * time.Millisecond}
loader := termloader.New(charsetConfig)Todo
- Loader
- Optional loading text support
- Optional image/icon support
- Add a gif
License
MIT

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


