helpers

package
v0.0.0-...-525bda9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package helpers Copyright 2021 VMware, Inc. SPDX-License-Identifier: BSD-2-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileToZip

func AddFileToZip(zipWriter *zip.Writer, filename string, basedir string) error

AddFileToZip - adds a file to a zip archive

func AskForConfirmation

func AskForConfirmation(s string) bool

AskForConfirmation - Credit - https://gist.github.com/r0l1/3dcbb0c8f6cfe9c66ab8008f55f8f28b

func CreateUserArray

func CreateUserArray(emails []string) []*models.User

CreateUserArray - Create an array of users from emails

func GetFilePaths

func GetFilePaths(filePath string, filetype string) []string

GetFilePaths - Get all files of type in a directory

func IsInputFromPipe

func IsInputFromPipe() bool

IsInputFromPipe - pipeline detection

func PrettyPrint

func PrettyPrint(v interface{}) (err error)

PrettyPrint prints interfaces

func PrintTable

func PrintTable(objects []interface{}, headers []string)

PrintTable prints an array of objects with table headers

func RemoveDuplicateStrings

func RemoveDuplicateStrings(elements []string) []string

RemoveDuplicateStrings - remote duplicate strings from a slice

func StringArrayContains

func StringArrayContains(s []string, str string) bool

StringArrayContains - check if a string array contains a string

func StringToTags

func StringToTags(tags string) []*models.Tag

StringToTags - split a string into tags

func UserArrayToString

func UserArrayToString(users []*models.User) string

UserArrayToString - Create an comma separated list of users from an array of users

func ZipFiles

func ZipFiles(filename string, files []string, basedir string) error

ZipFiles compresses one or many files into a single zip archive file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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