tool

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PBTheme = map[string]progressbar.Option{
	"=>": progressbar.OptionSetTheme(progressbar.Theme{
		Saucer:        "[green]=[reset]",
		SaucerHead:    "[green]>[reset]",
		SaucerPadding: " ",
		BarStart:      "[",
		BarEnd:        "]",
	}),
	"█": progressbar.OptionSetTheme(progressbar.Theme{
		Saucer:        "[green]█[reset]",
		SaucerHead:    "[green] [reset]",
		SaucerPadding: " ",
		BarStart:      "|",
		BarEnd:        "|",
	}),
}

Functions

func Download

func Download(url string, filepath string, descPrefix ...string) (int64, error)

descPrefix used for progressbar, format is like "[cyan]1/3[reset]", "Downloading..."

func Exec

func Exec(name string, args ...string) error

func ProgressBar added in v1.0.11

func ProgressBar(max int64, spin int, theme string, descPrefix ...string) *progressbar.ProgressBar

If max == -1, enable spinner progress bar, theme if one of PBTheme key

func TarGzCompress

func TarGzCompress(srcPath string, target string, verbose bool, descPrefix ...string) error

srcPath is the filepath to be compressed, target filename, eg: test.tar.gz

func TarGzUncompressing added in v1.0.11

func TarGzUncompressing(srcPath string, targetPath string, verbose bool, descPrefix ...string) error

srcPath is tar.gz file, targetPath is the output path

Types

This section is empty.

Jump to

Keyboard shortcuts

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