chore: add KV options.
This commit is contained in:
parent
6ebd39d55f
commit
ecfe5ad331
@ -11,21 +11,15 @@ var boltdbCmd = &cobra.Command{
|
||||
Use: "boltdb",
|
||||
Short: "TODO",
|
||||
Long: `TODO`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("boltdb called")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
kvCmd.AddCommand(boltdbCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// boltdbCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// boltdbCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
boltdbCmd.Flags().Bool("persist-connection", false, "Persist connection for boltdb.")
|
||||
boltdbCmd.Flags().String("bucket", "traefik", "Bucket for boltdb.")
|
||||
}
|
||||
|
||||
@ -11,21 +11,14 @@ var consulCmd = &cobra.Command{
|
||||
Use: "consul",
|
||||
Short: "TODO",
|
||||
Long: `TODO`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("consul called")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
kvCmd.AddCommand(consulCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// consulCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// consulCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
consulCmd.Flags().String("token", "", "Token for consul.")
|
||||
}
|
||||
|
||||
13
cmd/etcd.go
13
cmd/etcd.go
@ -11,21 +11,14 @@ var etcdCmd = &cobra.Command{
|
||||
Use: "etcd",
|
||||
Short: "TODO",
|
||||
Long: `TODO`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("etcd called")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
kvCmd.AddCommand(etcdCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// etcdCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// etcdCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
etcdCmd.Flags().Int("sync-period", 0, "Sync period for etcd in seconds.")
|
||||
}
|
||||
|
||||
18
cmd/kv.go
18
cmd/kv.go
@ -1,5 +1,3 @@
|
||||
// Copyright © 2019 ldez <lfernandez.dev@gmail.com>
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
@ -16,13 +14,13 @@ var kvCmd = &cobra.Command{
|
||||
func init() {
|
||||
rootCmd.AddCommand(kvCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
kvCmd.PersistentFlags().StringSlice("endpoints", []string{"localhost:8500"}, "Comma separated list of endpoints.")
|
||||
kvCmd.PersistentFlags().Int("connection-timeout", 0, "Connection timeout in seconds.")
|
||||
kvCmd.PersistentFlags().String("password", "", "Password for connection.")
|
||||
kvCmd.PersistentFlags().String("username", "", "Username for connection.")
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// kvCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// kvCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
// FIXME review TLS parts
|
||||
kvCmd.PersistentFlags().Bool("tls.enable", false, "Enable TLS encryption.")
|
||||
kvCmd.PersistentFlags().Bool("tls.insecureskipverify", false, "Trust unverified certificates if TLS is enabled.")
|
||||
kvCmd.PersistentFlags().String("tls.ca-cert-file", "", "Root CA file for certificate verification if TLS is enabled.")
|
||||
}
|
||||
|
||||
@ -11,21 +11,12 @@ var zookeeperCmd = &cobra.Command{
|
||||
Use: "zookeeper",
|
||||
Short: "TODO",
|
||||
Long: `TODO`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("zookeeper called")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
kvCmd.AddCommand(zookeeperCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// zookeeperCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// zookeeperCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user