utils

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskConfirmation

func AskConfirmation(message string) bool

func AskYesOrNo

func AskYesOrNo(message string) bool

func Contains

func Contains(s []string, e string) bool

func FormatMemory

func FormatMemory(memory *float64) string

func FormatProcessor

func FormatProcessor(proc *float64) string

func GenerateRandomString added in v0.1.3

func GenerateRandomString(length int) string

Generate random string of given length

func GenerateSpec added in v0.1.3

func GenerateSpec(NoOfTargetsPerSource int) pkg.Spec

Generate Specifications

func GunzipIt added in v0.1.9

func GunzipIt(src, dest string) error

GunzipIt the source file to target

func GzipIt added in v0.1.9

func GzipIt(src, dest string) error

GzipIt compresses the source file to dest

func IsGzip added in v0.1.9

func IsGzip(source string) (bool, error)

IsGzip returns if file is in gzip format

func MultiSelect added in v0.1.4

func MultiSelect(msg string, input []string) []string

func ReadUserInput

func ReadUserInput(message string) string

func RunCMD

func RunCMD(cmd string, args ...string) (int, string, string)

func SanitizeExtractPath added in v0.1.9

func SanitizeExtractPath(filePath string, destination string) error

func SelectItem

func SelectItem(msg string, instances []string) string

func Untar added in v0.1.9

func Untar(tarball, target, filename string) error

Extract specific file from the tar file

Types

type Table

type Table struct {
	*tablewriter.Table
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) Render

func (t *Table) Render(rows interface{}, exclude []string)

func (*Table) SetHeader

func (t *Table) SetHeader(keys []string)

Jump to

Keyboard shortcuts

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