Documentation ¶
Index ¶
- func BoolPrompt(prompt string, inputStream *os.File, outputStream *os.File) (bool, error)
- func Compress(filename string, compressedName string) error
- func DecodeBase64(s string) (string, error)
- func GetRandomString() string
- func MarshalToFile(v interface{}, filename string) error
- func OptionPrompt(prompt string, optionNum int, inputStream *os.File, outputStream *os.File) (int, error)
- func RenderTable(data [][]string, header []string, outputStream *os.File)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolPrompt ¶
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 DecodeBase64 ¶
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 ¶
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.
Types ¶
This section is empty.