util

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(streams genericclioptions.IOStreams, name string, args ...string) error

Exec executes the command and prints the output into current terminal

func GetAvailablePort added in v0.2.3

func GetAvailablePort() (int, error)

GetAvailablePort Get a available port randomly

func GetWithTracker

func GetWithTracker(req *getter.Request) error

GetWithTracker gets resources and tracks the progress

func ProgressBarConfig

func ProgressBarConfig(bar *pb.ProgressBar, prefix string)

ProgressBarConfig configures progressBar

Types

type ProgressBar

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

ProgressBar wraps a github.com/cheggaaa/pb.Pool in order to display download progress for one or multiple downloads.

If two different instance of ProgressBar try to display a progress only one will be displayed. It is therefore recommended to use DefaultProgressBar

func (*ProgressBar) TrackProgress

func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser

TrackProgress instantiates a new progress bar that will display the progress of stream until closed. total can be 0.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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