utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadWithCache

func DownloadWithCache(ctx context.Context, cacheDir, src, dest string, mode fs.FileMode, quiet bool) error

func DownloadWithCacheAndExtract

func DownloadWithCacheAndExtract(ctx context.Context, cacheDir, src, dest string, match string, mode fs.FileMode, quiet bool, clean bool) error

func Exec

func Exec(ctx context.Context, dir string, stm IOStreams, name string, arg ...string) error

func ForkExec

func ForkExec(ctx context.Context, dir string, name string, arg ...string) error

func ForkExecKill

func ForkExecKill(ctx context.Context, dir string, name string) error

func ForkExecRestart

func ForkExecRestart(ctx context.Context, dir string, name string) error

func GetUnusedPort

func GetUnusedPort() (int, error)

GetUnusedPort returns an unused port

func PathJoin

func PathJoin(elem ...string) string

func Untar

func Untar(src string, filter func(file string) (string, bool)) error

func Untargz

func Untargz(src string, filter func(file string) (string, bool)) error

func Unzip

func Unzip(src string, filter func(file string) (string, bool)) error

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

type ProgressBar

type ProgressBar struct {
	// contains filtered or unexported fields
}

func NewProgressBar

func NewProgressBar() *ProgressBar

func (*ProgressBar) Print

func (p *ProgressBar) Print()

func (*ProgressBar) Update

func (p *ProgressBar) Update(current, total int)

Jump to

Keyboard shortcuts

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