Exemple #1
0
func main() {
	config := config.NewConfig()
	err := config.Parse()
	if err != nil {
		panic(err)
	}

	if config.Server == true {
		fmt.Println("Starting in server mode")
		server.Serve()
		server.Bind()
	} else {
		pat.RunCommandLine(config.Concurrency, config.Iterations, config.Silent, config.Output, config.Interval, config.Stop, config.Workload)
	}
}
Exemple #2
0
func main() {
	useServer := false
	flags := config.ConfigAndFlags
	flags.BoolVar(&useServer, "server", false, "true to run the HTTP server interface")

	pat.InitCommandLineFlags(flags)
	flags.Parse(os.Args[1:])

	if useServer == true {
		fmt.Println("Starting in server mode")
		server.Serve()
		server.Bind()
	} else {
		pat.RunCommandLine()
	}
}