cmd

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: AGPL-3.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTagEmptyName   = errors.New("Invalid tag, empty name")
	ErrTagEmptyValue  = errors.New("Invalid tag, empty value")
	ErrTagEmptyString = errors.New("Invalid tag, empty string")
)
View Source
var BannerColor = color.New(color.FgCyan)
View Source
var RootCmd = &cobra.Command{
	Use:           "k6",
	Short:         "a next-generation load generator",
	Long:          BannerColor.Sprintf("\n%s", consts.Banner),
	SilenceUsage:  true,
	SilenceErrors: true,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		setupLoggers(logFmt)
		if noColor {

			stdout.Writer = colorable.NewNonColorable(os.Stdout)
			stderr.Writer = colorable.NewNonColorable(os.Stderr)
		}
		log.SetOutput(logrus.StandardLogger().Writer())
		logrus.Debugf("k6 version: v%s", consts.FullVersion())
	},
}

RootCmd represents the base command when called without any subcommands.

Functions

func Execute

func Execute()

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

Types

type Config

type Config struct {
	lib.Options

	Out           []string    `json:"out" envconfig:"K6_OUT"`
	Linger        null.Bool   `json:"linger" envconfig:"K6_LINGER"`
	NoUsageReport null.Bool   `json:"noUsageReport" envconfig:"K6_NO_USAGE_REPORT"`
	NoThresholds  null.Bool   `json:"noThresholds" envconfig:"K6_NO_THRESHOLDS"`
	NoSummary     null.Bool   `json:"noSummary" envconfig:"K6_NO_SUMMARY"`
	SummaryExport null.String `json:"summaryExport" envconfig:"K6_SUMMARY_EXPORT"`

	Collectors struct {
		InfluxDB influxdb.Config `json:"influxdb"`
		Kafka    kafka.Config    `json:"kafka"`
		Cloud    cloud.Config    `json:"cloud"`
		StatsD   common.Config   `json:"statsd"`
		Datadog  datadog.Config  `json:"datadog"`
		CSV      csv.Config      `json:"csv"`
	} `json:"collectors"`
}

func (Config) Apply

func (c Config) Apply(cfg Config) Config

func (Config) Validate added in v0.27.0

func (c Config) Validate() []error

Validate checks if all of the specified options make sense

type ExitCode

type ExitCode struct {
	Code int
	Hint string
	// contains filtered or unexported fields
}

ExitCode wraps the error with an exit code. Hint is used to show details information about underlying error.

type RawFormater added in v0.21.0

type RawFormater struct{}

RawFormatter it does nothing with the message just prints it

func (RawFormater) Format added in v0.21.0

func (f RawFormater) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

Jump to

Keyboard shortcuts

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