utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Quiet = false
)

Functions

func CacheDir

func CacheDir() string

func CopyFile added in v0.3.0

func CopyFile(src, dst string) (int64, error)

func DefaultCacheDir

func DefaultCacheDir() string

func Exec

func Exec(command string, args []string) (string, error)

func Exists

func Exists(path string) (bool, error)

func FileWalk

func FileWalk(root string, targetFiles map[string]struct{}, walkFn func(r io.Reader, path string) error) error

func FilterTargets

func FilterTargets(prefixPath string, targets map[string]struct{}) (map[string]struct{}, error)

func IsCommandAvailable

func IsCommandAvailable(name string) bool

func SetCacheDir

func SetCacheDir(dir string)

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type ProgressBar

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

TODO: Expose an interface for progressbar

func PbStartNew

func PbStartNew(total int) *ProgressBar

func (*ProgressBar) Finish

func (p *ProgressBar) Finish()

func (*ProgressBar) Increment

func (p *ProgressBar) Increment()

type Spinner

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

func NewSpinner

func NewSpinner(suffix string) *Spinner

func (*Spinner) Start

func (s *Spinner) Start()

func (*Spinner) Stop

func (s *Spinner) Stop()

Jump to

Keyboard shortcuts

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