Documentation ¶
Index ¶
- func AddPrefixToStrings(slice []string, prefix string) string
- func CheckMatchInSlices(slice1, slice2 []string) bool
- func CheckStringInSlice(slice []string, check string) bool
- func CommandExists(cmd string) (string, bool)
- func ConfigureFlagOpts(cmd *cobra.Command, lfcOpts *LoadFromCommandOpts) (interface{}, error)
- func Contains(s []string, str string) bool
- func ContainsWhitespace(str string) bool
- func CopyFile(src, dest string) error
- func CopyStringToFile(data, dest string) error
- func EmbedFileCopy(src fs.File, dst string) error
- func ExecCMD(command string, verbose bool) (string, error)
- func Exists(path string) (bool, error)
- func FilePathWalkDir(dirPath string) ([]string, error)
- func FormatStructToPrintableString(s interface{}) string
- func GetBaseDomain(domain string) string
- func GitClone(url, directory string) error
- func GitCloneDepthOne(url, directory string) error
- func Infof(format string, args ...interface{})
- func InstallPython3VirtualEnv() error
- func IsHeadless() bool
- func IsRoot() bool
- func IsValidSubdomain(sub string) bool
- func Less(a, b string) bool
- func LogError(err error) error
- func LogFatalf(format string, args ...interface{})
- func LogInfo(key, val, msg string)
- func LogWarningf(format string, args ...interface{})
- func MergeStringSlice(slice1 []string, slice2 []string) []string
- func PrependString(strs []string, s string) []string
- func PrettyPrint(v interface{}) (err error)
- func PrintInfo(key, val, msg string)
- func ReadLines(path string) ([]string, error)
- func RemoveDuplicateStr(strSlice []string) []string
- func ResolveAbsPath(path string) (string, error)
- func RunCommandPipeOutput(command string) error
- func RunCommandsPipeOutput(commands []string) error
- func SplitStringIfContainsSpace(input string) string
- func TimeTrack(start time.Time, name string)
- func WriteLines(lines []string, path string) error
- func WriteStringToFile(outputFile, data string) error
- func WriteStructToJSONFile(data interface{}, outputFile string) error
- func WriteToCSVAndJSONFiles(data map[string][]string, fileName string) error
- type Client
- type LoadFromCommandOpts
- type PipInstalled
- type StringSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPrefixToStrings ¶ added in v2.5.8
AddPrefixToStrings ...
func CheckMatchInSlices ¶
CheckMatchInSlices ...
func CheckStringInSlice ¶
CheckStringInSlice ...
func ConfigureFlagOpts ¶
func ConfigureFlagOpts(cmd *cobra.Command, lfcOpts *LoadFromCommandOpts) (interface{}, error)
ConfigureFlagOpts sets the cobra flag option to the LoadFromCommandOpts.Opts key it returns the parsed value of the cobra flag from LoadFromCommandOpts.Flag
func ContainsWhitespace ¶ added in v2.5.8
func FormatStructToPrintableString ¶ added in v2.6.1
func FormatStructToPrintableString(s interface{}) string
func GetBaseDomain ¶ added in v2.5.8
GetBaseDomain gets a base domain without tld, ex. foobar.baz would return foobar. foo.bar.baz would return an empty string
func GitCloneDepthOne ¶
GitCloneDepthOne clones a public git repo url to directory
func InstallPython3VirtualEnv ¶
func InstallPython3VirtualEnv() error
InstallPython3VirtualEnv installs virtualenv via apt
func IsHeadless ¶
func IsHeadless() bool
IsHeadless checks the DISPLAY env var to check if the server you're running this program on has a GUI / Desktop Environment
func IsValidSubdomain ¶
IsValidSubdomain checks if a string contains two or more dots and if it is a valid dns name
func LogFatalf ¶
func LogFatalf(format string, args ...interface{})
LogFatalf is a wrapper around gologger Fatal method
func LogWarningf ¶
func LogWarningf(format string, args ...interface{})
LogWarningf logs a warning to stdout
func MergeStringSlice ¶ added in v2.5.8
MergeStringSlice ...
func PrependString ¶
func PrettyPrint ¶
func PrettyPrint(v interface{}) (err error)
func PrintInfo ¶
func PrintInfo(key, val, msg string)
PrintInfo is a wrapper around gologger Info method
func RemoveDuplicateStr ¶
RemoveDuplicateStr removes duplicate strings from a slice of strings
func RunCommandPipeOutput ¶
RunCommandPipeOutput runs a bash command and pipes the output to stdout in realtime also has a built-in timer that tracks execution duration it returns an error
func RunCommandsPipeOutput ¶
RunCommandsPipeOutput ...
func SplitStringIfContainsSpace ¶ added in v2.5.8
SplitStringIfContainsSpace ...
func WriteLines ¶
WriteLines writes the lines to the given file.
func WriteStringToFile ¶
WriteStringToFile writes a string to a file
func WriteStructToJSONFile ¶
WriteStructToJSONFile ...
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient() *Client
type LoadFromCommandOpts ¶
type PipInstalled ¶
type PipInstalled struct {
Name []string
}
func NewPipInstalled ¶
func NewPipInstalled() (*PipInstalled, error)
NewPipInstalled returns a slice of all the installed python3 pip packages
type StringSlice ¶
type StringSlice []string
StringSlice attaches the methods of Interface to []string, sorting in increasing order using natural order.
func (StringSlice) Len ¶
func (p StringSlice) Len() int
func (StringSlice) Less ¶
func (p StringSlice) Less(i, j int) bool
func (StringSlice) Swap ¶
func (p StringSlice) Swap(i, j int)