Documentation ¶
Overview ¶
Package helpers Copyright 2021 VMware, Inc. SPDX-License-Identifier: BSD-2-Clause
Index ¶
- func AddFileToZip(zipWriter *zip.Writer, filename string, basedir string) error
- func AskForConfirmation(s string) bool
- func CreateUserArray(emails []string) []*models.User
- func GetFilePaths(filePath string, filetype string) []string
- func IsInputFromPipe() bool
- func PrettyPrint(v interface{}) (err error)
- func PrintTable(objects []interface{}, headers []string)
- func RemoveDuplicateStrings(elements []string) []string
- func StringArrayContains(s []string, str string) bool
- func StringToTags(tags string) []*models.Tag
- func UserArrayToString(users []*models.User) string
- func ZipFiles(filename string, files []string, basedir string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileToZip ¶
AddFileToZip - adds a file to a zip archive
func AskForConfirmation ¶
AskForConfirmation - Credit - https://gist.github.com/r0l1/3dcbb0c8f6cfe9c66ab8008f55f8f28b
func CreateUserArray ¶
CreateUserArray - Create an array of users from emails
func GetFilePaths ¶
GetFilePaths - Get all files of type in a directory
func PrintTable ¶
func PrintTable(objects []interface{}, headers []string)
PrintTable prints an array of objects with table headers
func RemoveDuplicateStrings ¶
RemoveDuplicateStrings - remote duplicate strings from a slice
func StringArrayContains ¶
StringArrayContains - check if a string array contains a string
func StringToTags ¶
StringToTags - split a string into tags
func UserArrayToString ¶
UserArrayToString - Create an comma separated list of users from an array of users
Types ¶
This section is empty.