Documentation ¶
Index ¶
- Variables
- func AddPrefixToStrings(slice []string, prefix string) string
- func AptInstall(packages *AptInstalled, aptName ...string) error
- func CheckMatchInSlices(slice1, slice2 []string) bool
- func CheckSingleMatchInSlices(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 ExtractBaseDomain(target string) (string, error)
- func FilePathWalkDir(dirPath string) ([]string, error)
- func FormatStructToPrintableString(s interface{}) string
- func GetBaseDomain(domain string) string
- func GetMatchedURLsStringsSlice(strs []string, targets []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, logCommand bool) error
- func RunCommandsPipeOutput(commands []string, logCommand bool) error
- func SliceContainsWords(slice1 []string, slice2 []string) bool
- func SortUnique(slice []string) []string
- func SplitStringIfContainsSpace(input string) string
- func TimeTrack(start time.Time, name string)
- func VersionGreaterOrEqual(versionString string, minVersionString string) bool
- 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 AptInstalled
- type Client
- type LoadFromCommandOpts
- type PipInstalled
- type PythonVersions
- type StringSlice
- type Version
Constants ¶
This section is empty.
Variables ¶
var (
AlphaTLDs = []string{}/* 1480 elements not displayed */
)
Functions ¶
func AddPrefixToStrings ¶ added in v2.5.8
AddPrefixToStrings ...
func AptInstall ¶ added in v2.7.3
func AptInstall(packages *AptInstalled, aptName ...string) error
AptInstall ...
func CheckMatchInSlices ¶
CheckMatchInSlices ...
func CheckSingleMatchInSlices ¶ added in v2.7.3
CheckSingleMatchInSlices ...
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 ExtractBaseDomain ¶ added in v2.6.3
ExtractBaseDomain extracts the base domain from a given URL or DNS name
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 GetMatchedURLsStringsSlice ¶ added in v2.7.6
GetMatchedURLsStringsSlice ...
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 and stderr in realtime also has a built-in timer that tracks execution duration. logCommand also functions as verbosity param. TODO add additional verbosity param it returns an error
func RunCommandsPipeOutput ¶
RunCommandsPipeOutput ...
func SliceContainsWords ¶ added in v2.6.2
SliceContainsWords ...
func SplitStringIfContainsSpace ¶ added in v2.5.8
SplitStringIfContainsSpace ...
func VersionGreaterOrEqual ¶ added in v2.6.9
VersionGreaterOrEqual ...
func WriteLines ¶
WriteLines writes the lines to the given file.
func WriteStringToFile ¶
WriteStringToFile writes a string to a file
func WriteStructToJSONFile ¶
WriteStructToJSONFile ...
Types ¶
type AptInstalled ¶ added in v2.7.3
type AptInstalled struct {
Name []string
}
AptInstalled ...
func NewAptInstalled ¶ added in v2.7.3
func NewAptInstalled() (*AptInstalled, error)
NewAptInstalled ...
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient() *Client
type LoadFromCommandOpts ¶
type PipInstalled ¶
type PipInstalled struct { Name []string Versions PythonVersions }
func NewPipInstalled ¶
func NewPipInstalled() (*PipInstalled, error)
NewPipInstalled returns a slice of all the installed python3 pip packages
type PythonVersions ¶ added in v2.6.9
func GetPythonAndPipVersion ¶ added in v2.6.9
func GetPythonAndPipVersion() (*PythonVersions, error)
GetPythonAndPipVersion ...
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)