cmdutil

package
v0.0.0-...-3924ef3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPrompt

func BoolPrompt(prompt string, inputStream *os.File, outputStream *os.File) (bool, error)

BoolPrompt generates a bool prompt in the output stream. It will only return the answer when getting "y" or "N", otherwise each time an invalid input is given, the prompt will be outputted again.

func Compress

func Compress(filename string, compressedName string) error

Compress creates a gzipped archive (.tar.gz) for a folder.

func DecodeBase64

func DecodeBase64(s string) (string, error)

DecodeBase64 decodes a base64 string.

func GetRandomString

func GetRandomString() string

GetRandomString returns a string of length 15 consisting of lower-case characters and numbers.

func MarshalToFile

func MarshalToFile(v interface{}, filename string) error

MarshalToFile marshals an object to a json string and writes it to a file.

func OptionPrompt

func OptionPrompt(prompt string, optionNum int, inputStream *os.File, outputStream *os.File) (int, error)

OptionPrompt generates an option prompt in the output stream. It will only return the choice when getting a valid answer (an integer between [0,optionNum-1]), otherwise each time an invalid input is given, the prompt will be outputted again.

func RenderTable

func RenderTable(data [][]string, header []string, outputStream *os.File)

RenderTable renders the 2D string array to the output stream in table format with the given header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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