Rework directory structure

Co-authored-by: Héctor Hurtado <hector.hurtado@bbva.com>
This commit is contained in:
pancho horrillo
2019-10-03 12:05:53 +02:00
parent 8b7d1d69e7
commit 23128026c7
12 changed files with 12 additions and 12 deletions
+26
View File
@@ -0,0 +1,26 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
//SetCmd is the command line interface for set kapow data operation
var SetCmd = &cobra.Command{
Use: "set [flags] resource [value]",
Short: "Set a Kapow! resource value",
Long: "Set a Kapow! resource value for the current request",
Args: cobra.RangeArgs(1, 2),
PreRunE: handlerIDRequired,
Run: func(cmd *cobra.Command, args []string) {
url, _ := cmd.Flags().GetString("url")
handler, _ := cmd.Flags().GetString("handler")
fmt.Println("niano: ", url, handler)
},
}
func init() {
SetCmd.Flags().String("url", getEnv("KAPOW_URL", "http://localhost:8082"), "Kapow! data interface URL")
SetCmd.Flags().String("handler", getEnv("KAPOW_HANDLER_ID", ""), "Kapow! handler id")
}