cmd

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ExitCodeExecutionError error during execution
	ExitCodeExecutionError int = 0x80 + iota
	// ExitCodeJSONParseError error parsing JSON config
	ExitCodeJSONParseError
	// ExitCodeJSONValidateError validating JSON config failed
	ExitCodeJSONValidateError
	// ExitCodeLogFormatError error resolving log format
	ExitCodeLogFormatError
	// ExitCodeObjectDefError error reading object definitions
	ExitCodeObjectDefError
	// ExitCodeProfilingError error starting profiling
	ExitCodeProfilingError
	// ExitCodeMetricError error starting prometheus
	ExitCodeMetricError
	// ExitCodeOsError error when interacting with host OS
	ExitCodeOsError
	// ExitCodeSummaryTypeError incorrect summary type
	ExitCodeSummaryTypeError
	// ExitCodeConnectionError error during test connection
	ExitCodeConnectionError
	// ExitCodeAppStructure error during get app structure
	ExitCodeAppStructure
	// ExitCodeMissingParameter
	ExitCodeMissingParameter
)

Unfortunately go doesn't support negative exit codes, so same logic as sdkexerciser can't be used (positive for error count and negative for other errors) as exit codes seems to be limited to 8 bits (even though defined as an int), we will use setting the highest bit as a representation of negative values, i.e. errors not corresponding to simulation errors. Exit codes with highest bit set to 0 corresponds to error count from simulation, where 0x7F will represent >127 errors.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "gopherciser",
	Short: "User simulation tool",
	Long:  `Tool to simulate user actions in a sense application`,
}

RootCmd represents the base command when called without any sub-commands

Functions

func AddAllSharedParameters

func AddAllSharedParameters(cmd *cobra.Command)

AddAllSharedParameters add shared parameters to command

func AddConfigParameter

func AddConfigParameter(cmd *cobra.Command)

AddConfigParameter add config file parameter to command

func AddLoggingParameters added in v0.5.2

func AddLoggingParameters(cmd *cobra.Command)

AddLoggingParameters add logging parameters to command

func AddOverrideParameters added in v0.6.15

func AddOverrideParameters(cmd *cobra.Command)

AddOverrideParameters to command

func ConfigOverrideLogSettings added in v0.5.2

func ConfigOverrideLogSettings(cfg *config.Config) error

ConfigOverrideLogSettings override log settings with parameters

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func PrintOverrides added in v0.6.15

func PrintOverrides(overrides []string)

PrintOverrides to script

func ReadObjectDefinitions

func ReadObjectDefinitions() error

Types

type JSONParseError

type JSONParseError string

JSONParseError error during unmarshal of JSON file

func (JSONParseError) Error

func (err JSONParseError) Error() string

Error implementation of Error interface

type JSONValidateError

type JSONValidateError string

JSONValidateError error during validation of JSON file

func (JSONValidateError) Error

func (err JSONValidateError) Error() string

Error implementation of Error interface

type LogFormatError

type LogFormatError string

LogFormatError error resolving log format

func (LogFormatError) Error

func (err LogFormatError) Error() string

Error implementation of Error interface

type MetricError

type MetricError string

MetricError error starting profiling

func (MetricError) Error

func (err MetricError) Error() string

Error implementation of Error interface

type ObjectDefError

type ObjectDefError string

ObjectDefError error reading object definitions

func (ObjectDefError) Error

func (err ObjectDefError) Error() string

Error implementation of Error interface

type OsError

type OsError string

OsError error when interacting with host OS

func (OsError) Error

func (err OsError) Error() string

Error implementation of Error interface

type ProfilingError

type ProfilingError string

ProfilingError error starting profiling

func (ProfilingError) Error

func (err ProfilingError) Error() string

Error implementation of Error interface

type SummaryTypeError

type SummaryTypeError string

SummaryTypeError incorrect summary type

func (SummaryTypeError) Error

func (err SummaryTypeError) Error() string

Error incorrect summary type

Jump to

Keyboard shortcuts

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