cmd

package
v0.51.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFilename is the forge config file without extension
	ConfigFilename = ".stormforger"
	// EnvPrefix is the prefix for environment configuration
	EnvPrefix = "stormforger"
)

Variables

View Source
var (
	// RootCmd represents the cobra root command
	RootCmd = &cobra.Command{
		Use: "forge",
		PersistentPreRun: func(cmd *cobra.Command, args []string) {
			if !stringutil.InSlice(rootOpts.OutputFormat, []string{"human", "plain", "json"}) {
				log.Fatalf("Unknown output format '%s'", rootOpts.OutputFormat)
			}
		},
		Short: "Command line client to StormForger (https://stormforger.com)",
		Long: `The command line client "forge" to StormForger offers a interface
to the StormForger API and several convenience methods
to handle load and performance tests.

Happy Load Testing :)`,
	}
)
View Source
var TestCaseCmd = &cobra.Command{
	Use:     "test-case",
	Aliases: []string{"testcase", "tc"},
	Short:   "Work with and manage test cases",
	Long:    `Work with and manage test cases.`,
}

TestCaseCmd is the cobra definition

View Source
var TestRunCmd = &cobra.Command{
	Use:     "test-run",
	Aliases: []string{"testrun", "tr"},
	Short:   "Work with and manage test runs",
	Long:    `Work with and manage test runs.`,
}

TestRunCmd is the cobra definition

Functions

func Execute

func Execute()

Execute is the entry function for cobra

func MainDataSourcePush added in v0.38.0

func MainDataSourcePush(client *api.Client, pushOpts PushOpts, args []string)

func MainServiceAccountsCreate added in v0.44.0

func MainServiceAccountsCreate(client *api.Client, org, token_label string) (*serviceaccount.ServiceAccount, error)

func MainServiceAccountsList added in v0.44.0

func MainServiceAccountsList(client *api.Client, org string) (*serviceaccount.List, error)

func MainTestRunLaunch added in v0.38.0

func MainTestRunLaunch(client *api.Client, testCaseSpec string, testRunLaunchOpts testRunLaunchCmdOpts)

MainTestRunLaunch runs a test-case and allows watching and validation that test-run. testCaseSpec is required and specifies the test-case to launch.

func MainTestcaseBuild added in v0.43.1

func MainTestcaseBuild(w io.Writer, file string, defines map[string]string) error

func NewClient

func NewClient() *api.Client

NewClient initializes a new API Client

func PrintHumanPingResult added in v0.39.0

func PrintHumanPingResult(w io.Writer, result PingCommandResult)

func ShowDetails added in v0.36.0

func ShowDetails(fileFixture *filefixture.FileFixture)

ShowDetails print out details of a file fixture, including its current version

Types

type NfrChecker added in v0.48.5

type NfrChecker struct {
	Client       *api.Client
	TestRunUID   string
	ResultFilter func(items testrun.NfrResultList) testrun.NfrResultList
}

type PingCommandResult added in v0.39.0

type PingCommandResult struct {
	Success  bool            `json:"success"`            // set to true if the ping was successful
	Error    error           `json:"error,omitempty"`    // Available if the ping call failed on a fundamental way (network error, unparsable response etc)
	Response json.RawMessage `json:"response,omitempty"` // Available if we talked to the StormForger API

	Unauthenticated bool      `json:"unauthenticated"`   // True if the ping command was unauthenticated
	Subject         *api.User `json:"subject,omitempty"` // Available if the ping suceeded and was an authenticated ping
}

type PushOpts added in v0.38.0

type PushOpts struct {
	Raw             bool
	Delimiter       string
	FieldNames      string
	Name            string
	NamePrefixPath  string
	FirstRowHeaders bool
}

Jump to

Keyboard shortcuts

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