Пример #1
0
func main() {
	app := cli.NewApp()
	app.Name = "etcdctlv3"
	app.Version = version.Version
	app.Usage = "A simple command line client for etcd3."
	app.Commands = []cli.Command{
		command.NewRangeCommand(),
		command.NewPutCommand(),
		command.NewDeleteRangeCommand(),
	}

	app.Run(os.Args)
}
Пример #2
0
func init() {
	rootCmd.PersistentFlags().StringVar(&globalFlags.Endpoints, "endpoint", "127.0.0.1:2378", "gRPC endpoint")

	rootCmd.AddCommand(
		command.NewRangeCommand(),
		command.NewPutCommand(),
		command.NewDeleteRangeCommand(),
		command.NewTxnCommand(),
		command.NewCompactionCommand(),
		command.NewWatchCommand(),
		command.NewVersionCommand(),
	)
}
Пример #3
0
func main() {
	app := cli.NewApp()
	app.Name = "etcdctlv3"
	app.Version = version.Version
	app.Usage = "A simple command line client for etcd3."
	app.Flags = []cli.Flag{
		cli.StringFlag{Name: "endpoint", Value: "127.0.0.1:2378", Usage: "gRPC endpoint"},
	}
	app.Commands = []cli.Command{
		command.NewRangeCommand(),
		command.NewPutCommand(),
		command.NewDeleteRangeCommand(),
		command.NewTxnCommand(),
		command.NewCompactionCommand(),
	}

	app.Run(os.Args)
}
Пример #4
0
func init() {
	rootCmd.PersistentFlags().StringVar(&globalFlags.Endpoints, "endpoint", "127.0.0.1:2378", "gRPC endpoint")

	rootCmd.PersistentFlags().StringVar(&globalFlags.TLS.CertFile, "cert", "", "identify HTTPS client using this SSL certificate file")
	rootCmd.PersistentFlags().StringVar(&globalFlags.TLS.KeyFile, "key", "", "identify HTTPS client using this SSL key file")
	rootCmd.PersistentFlags().StringVar(&globalFlags.TLS.CAFile, "cacert", "", "verify certificates of HTTPS-enabled servers using this CA bundle")

	rootCmd.AddCommand(
		command.NewRangeCommand(),
		command.NewPutCommand(),
		command.NewDeleteRangeCommand(),
		command.NewTxnCommand(),
		command.NewCompactionCommand(),
		command.NewWatchCommand(),
		command.NewVersionCommand(),
		command.NewLeaseCommand(),
		command.NewMemberCommand(),
	)
}