Documentation ¶
Index ¶
- Variables
- func ClearBOM(r io.Reader) io.Reader
- func FileName(suffix string) string
- func GetCommit() string
- func GetPCEbyName(name string, GetLabelMaps bool) (illumioapi.PCE, error)
- func GetPCEbyNameV2(name string, GetLabelMaps bool) (illumioapi.PCE, error)
- func GetProcesses(file string) ([]string, error)
- func GetServicePortsCSV(filename string) ([][2]int, error)
- func GetServicePortsPCE(pce illumioapi.PCE, serviceName string) ([][2]int, [][3]int)
- func GetTargetPCE(GetLabelMaps bool) (illumioapi.PCE, error)
- func GetTargetPCEV2(GetLabelMaps bool) (illumioapi.PCE, error)
- func GetVersion() string
- func IsRFC1918(ipAddress string) bool
- func LogAPIResp(callType string, apiResp illumioapi.APIResponse)
- func LogAPIRespV2(callType string, apiResp illumioapi.APIResponse)
- func LogBlankValue(val string) string
- func LogDebug(msg string)
- func LogEndCommand(commandName string)
- func LogError(msg string)
- func LogErrorf(format string, a ...any)
- func LogErrorfCode(exitCode int, format string, a ...any)
- func LogInfo(msg string, stdout bool)
- func LogInfof(stdout bool, format string, a ...any)
- func LogMultiAPIResp(APIResps map[string]illumioapi.APIResponse)
- func LogMultiAPIRespV2(APIResps map[string]illumioapi.APIResponse)
- func LogOutDesc() string
- func LogStartCommand(fullCommand string)
- func LogWarning(msg string, stdout bool)
- func LogWarningf(stdout bool, format string, a ...any)
- func ParseCSV(filename string) ([][]string, error)
- func ParseCsvHeaders(filename string) (csvData [][]string, headerMap map[string]int, err error)
- func PtrToStr(ptr *string) string
- func ReplaceNewLine(s string) string
- func RootTemplate() string
- func SRootCmdTemplate() string
- func SetUpLogging()
- func SliceComare(slice1 []string, slice2 []string, slice1Name, slice2Name string) (equal bool, logMsg string)
- func StrToPtr(str string) *string
- func SubCmdTemplate() string
- func UseMulti() bool
- func WriteLineOutput(csvLine []string, csvFileName string)
- func WriteOutput(csvData, stdOutData [][]string, csvFileName string)
Constants ¶
This section is empty.
Variables ¶
var Commit string
Commit is the latest commit
var Logger log.Logger
Logger is the global logger for Workloader
var Version string
Version is set by build variable
Functions ¶
func GetCommit ¶
func GetCommit() string
GetCommit returns the latest commit set by the build variable
func GetPCEbyName ¶
func GetPCEbyName(name string, GetLabelMaps bool) (illumioapi.PCE, error)
GetPCEbyName gets a PCE by it's provided name
func GetPCEbyNameV2 ¶
GetPCEbyName gets a PCE by it's provided name
func GetProcesses ¶
GetProcesses returns a list of processes from an inputfile
func GetServicePortsCSV ¶
GetServicePortsCSV returns port proto list from a CSV
func GetServicePortsPCE ¶
func GetServicePortsPCE(pce illumioapi.PCE, serviceName string) ([][2]int, [][3]int)
GetServicePortsPCE returns PortProto list and PortRangeProto for use in a traffic query from a service object in the PCE
func GetTargetPCE ¶
func GetTargetPCE(GetLabelMaps bool) (illumioapi.PCE, error)
GetTargetPCE gets the target PCE for a command
func GetTargetPCEV2 ¶
GetTargetPCE gets the target PCE for a command
func GetVersion ¶
func GetVersion() string
GetVersion returns the version set by the build variable reads the PCE information from the JSON generated by the login command
func LogAPIResp ¶
func LogAPIResp(callType string, apiResp illumioapi.APIResponse)
LogAPIResp will log the HTTP Requset, Request Header, Response Status Code, and Response Body The callType should be the name of call: GetAllLabels, GetAllWorkloads, etc. This is just for logging purposes and any string will be accepted. The log type will be DEBUG. This call will not do anything if the debug flag isn't set. A debug conditional is not required in app code.
func LogAPIRespV2 ¶
func LogAPIRespV2(callType string, apiResp illumioapi.APIResponse)
LogAPIResp will log the HTTP Requset, Request Header, Response Status Code, and Response Body The callType should be the name of call: GetAllLabels, GetAllWorkloads, etc. This is just for logging purposes and any string will be accepted. The log type will be DEBUG. This call will not do anything if the debug flag isn't set. A debug conditional is not required in app code.
func LogDebug ¶
func LogDebug(msg string)
LogDebug writes the log to workloader.log only if debug flag is set and never prints to stdout. Debug logic is not required in code.
func LogEndCommand ¶
func LogEndCommand(commandName string)
LogEndCommand is used at the end of each command
func LogError ¶
func LogError(msg string)
LogError writes the error the workloader.log and always prints an error to stdout.
func LogErrorf ¶
LogErrorf uses string formatting to write to log to workloader.log and always prints msg to stdout.
func LogErrorfCode ¶
LogErrorfCode a custom exitCode and uses string formatting to write to log to workloader.log and always prints msg to stdout.
func LogInfof ¶
LogInfof uses string formatting to write to log to workloader.log and optionally prints msg to stdout.
func LogMultiAPIResp ¶
func LogMultiAPIResp(APIResps map[string]illumioapi.APIResponse)
func LogMultiAPIRespV2 ¶
func LogMultiAPIRespV2(APIResps map[string]illumioapi.APIResponse)
func LogOutDesc ¶
func LogOutDesc() string
LogOutDesc returns the text of the logout command based on runtime
func LogStartCommand ¶
func LogStartCommand(fullCommand string)
LogStartCommand is used at the beginning of each command
func LogWarning ¶
LogWarning writes the log to workloader.log and optionally prints msg to stdout.
func LogWarningf ¶
LogWarningf uses string formatting to write to log to workloader.log and optionally prints msg to stdout.
func ParseCsvHeaders ¶
ParseCsvHeaders parses a file and returns a slice of slice of strings and header map The header map points to the header index in the slice
func ReplaceNewLine ¶
ReplaceNewLine replaces the \r and \n with a space
func SRootCmdTemplate ¶
func SRootCmdTemplate() string
SRootCmdTemplate returns the usage template for sub root commands
func SetUpLogging ¶
func SetUpLogging()
func SliceComare ¶
func SubCmdTemplate ¶
func SubCmdTemplate() string
SubCmdTemplate returns the usage template used for all subcommands
func WriteLineOutput ¶
WriteLineOutput will write the CSV one line at a time
func WriteOutput ¶
WriteOutput will write the CSV and/or stdout data based on the viper configuration
Types ¶
This section is empty.