Documentation ¶
Index ¶
- func AbortForCommand(cmd *cobra.Command, cliError *model.CliError)
- func AbortForCommandWithSubResource(cmd *cobra.Command, cliError *model.CliError, subResource, operation string)
- func AbortWithExitCode(message string, code int)
- func AbortWithUsageAndMessageAndCode(cmd *cobra.Command, message string, code int)
- func Bold(a ...interface{}) string
- func ByteArrayToStruct(cmd *cobra.Command, byt []byte, payloadObject interface{})
- func CamelToTitle(inp string) string
- func CheckAndPrintJson(jsonOutput bool, data interface{})
- func CheckIfBothJsonAndFlagAreSetForCommand(cmd *cobra.Command, jsonData []byte, isStandardInputAvailable bool) bool
- func ClientProfileInCLIOutputFormat(clientProfile model.ClientProfile) string
- func ContainsIgnoreCase(a string, b string) bool
- func ContainsInArray(array []string, inputString string) bool
- func ConvertBooleanToYesOrNo(input bool) string
- func FindSuggestions(cmd *cobra.Command, arg string) string
- func FormatTime(inputTime string) string
- func GetApiErrorMessagesForCommand(cmd *cobra.Command, apiError model.ApiError, ...) []string
- func GetApiSubErrorMessagesForCommand(cmd *cobra.Command, apiSubError []model.ApiSubError, ...) []string
- func GetColourForEnum(enum string, bold bool) color.Color
- func GetConvertedInteger(number string) int
- func GetEdgeGridErrorMessage(key string) string
- func GetErrorMessageForFlag(cmd *cobra.Command, errorType, flagKeyInJson string) string
- func GetErrorMessageForSubArgument(cmd *cobra.Command, errorType, subCommandKeyInJson string) string
- func GetGlobalErrorMessage(key string) string
- func GetHttpExitCode(responseCode string) int
- func GetJsonKeyForFlag(flag string) string
- func GetMessageForKey(baseCmdPath *cobra.Command, key string) string
- func GetPlaceHoldersInString(errorMessage, regex string) []string
- func GetResolvedOrUnResolvedCondition(condition model.Condition) string
- func GetResolvedOrUnResolvedHeaders(header model.RequestHeader) string
- func GetResolvedOrUnResolvedRequestBody(testRequest model.TestRequest) string
- func GetResolvedOrUnResolvedRequestURL(testRequest model.TestRequest) string
- func GetServiceMessage(cmd *cobra.Command, messageType string, subresource string, jsonKey string) string
- func GetStatusKeyAndColour(status string) (string, color.Color)
- func GetTotalTestCasesCount(testCases []model.TestCase) int
- func Italic(a ...interface{}) string
- func LegacyArgs(cmd *cobra.Command, args []string) error
- func NoArgsCheck(cmd *cobra.Command, args []string) error
- func PrintError(message string, args ...interface{})
- func PrintErrorMessages(errorMessages []string)
- func PrintHeader(message string, args ...interface{})
- func PrintJsonAndExit(data interface{})
- func PrintLabelAndValue(label string, value interface{})
- func PrintLabelValueWithColour(label string, clr *color.Color, value interface{})
- func PrintRawRequestResponseHeaders(requestResponseHeaders []model.Header)
- func PrintSuccess(message string, args ...interface{})
- func PrintSuccessInBold(message string, args ...interface{})
- func PrintTemplate(templateToParse string, data interface{})
- func PrintTotalItems(count int)
- func PrintWarning(message string, args ...interface{})
- func PrintWarnings(waringMessages []string)
- func ReadStdin(cmd *cobra.Command) (bool, []byte)
- func RequestHeaderInCLIOutputFormat(headerName, headerAction, headerValue string) string
- func SetVariablesInCLIOutputFormat(variable model.DynamicVariable) string
- func ShowTable(tableHeaders []string, tableContents [][]string, showTotal bool)
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortWithExitCode ¶
func ByteArrayToStruct ¶
func CamelToTitle ¶
func CheckAndPrintJson ¶
func CheckAndPrintJson(jsonOutput bool, data interface{})
print json output if flag is passed
func CheckIfBothJsonAndFlagAreSetForCommand ¶
func CheckIfBothJsonAndFlagAreSetForCommand(cmd *cobra.Command, jsonData []byte, isStandardInputAvailable bool) bool
CheckIfBothJsonAndFlagAreSetForCommand method returns true if json input is set, otherwise false
func ClientProfileInCLIOutputFormat ¶
func ClientProfileInCLIOutputFormat(clientProfile model.ClientProfile) string
func ContainsIgnoreCase ¶
Check contains and irrespective of case.
func ContainsInArray ¶
Check contains and irrespective of case.
func ConvertBooleanToYesOrNo ¶
func FindSuggestions ¶
FindSuggestions returns a list possible subcommands referenced cobra.command findSuggestions() library
func FormatTime ¶
func GetApiSubErrorMessagesForCommand ¶
func GetApiSubErrorMessagesForCommand(cmd *cobra.Command, apiSubError []model.ApiSubError, parentErrorKey, subResource, operation string) []string
Get All the error messages for api sub errors
func GetConvertedInteger ¶
func GetEdgeGridErrorMessage ¶
Get edge grid errors for given key
func GetErrorMessageForFlag ¶
Get different type of message for flag
func GetErrorMessageForSubArgument ¶
func GetErrorMessageForSubArgument(cmd *cobra.Command, errorType, subCommandKeyInJson string) string
GetErrorMessageForSubArgument different type of message for invalid argument
func GetGlobalErrorMessage ¶
Get global errors for given key
func GetHttpExitCode ¶
GetHttpExitCode get equivalent exit status code for corresponding http status code
func GetJsonKeyForFlag ¶
func GetMessageForKey ¶
Return message for given key under command.
func GetPlaceHoldersInString ¶
Get all placeholders in string inside {{}}
func GetResolvedOrUnResolvedHeaders ¶
func GetResolvedOrUnResolvedHeaders(header model.RequestHeader) string
func GetResolvedOrUnResolvedRequestBody ¶
func GetResolvedOrUnResolvedRequestBody(testRequest model.TestRequest) string
func GetResolvedOrUnResolvedRequestURL ¶
func GetResolvedOrUnResolvedRequestURL(testRequest model.TestRequest) string
func GetServiceMessage ¶
func GetServiceMessage(cmd *cobra.Command, messageType string, subresource string, jsonKey string) string
GetServiceMessage different type of service messages based on commands and messageType
func GetTotalTestCasesCount ¶
func LegacyArgs ¶
LegacyArgs is used to invalidate unknown subcommands took reference from cobra.args legacyArgs() library
func NoArgsCheck ¶
NoArgsCheck returns an error if any args are included.
func PrintError ¶
func PrintError(message string, args ...interface{})
PrintError Start Standard Print Functions
func PrintErrorMessages ¶
func PrintErrorMessages(errorMessages []string)
func PrintHeader ¶
func PrintHeader(message string, args ...interface{})
func PrintJsonAndExit ¶
func PrintJsonAndExit(data interface{})
func PrintLabelAndValue ¶
func PrintLabelAndValue(label string, value interface{})
func PrintSuccess ¶
func PrintSuccess(message string, args ...interface{})
func PrintSuccessInBold ¶
func PrintSuccessInBold(message string, args ...interface{})
func PrintTemplate ¶
func PrintTemplate(templateToParse string, data interface{})
func PrintTotalItems ¶
func PrintTotalItems(count int)
func PrintWarning ¶
func PrintWarning(message string, args ...interface{})
func PrintWarnings ¶
func PrintWarnings(waringMessages []string)
func SetVariablesInCLIOutputFormat ¶
func SetVariablesInCLIOutputFormat(variable model.DynamicVariable) string
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶
func (Spinner) StopWithFailure ¶
func (s Spinner) StopWithFailure()
func (Spinner) StopWithSuccess ¶
func (s Spinner) StopWithSuccess()