chore(idp): Rename cmd/idp to cmd/influx

pull/10616/head
Nathaniel Cook 2018-05-24 11:34:39 -06:00
parent 5705f33f55
commit 1e1c6e21e5
10 changed files with 71 additions and 71 deletions

2
.gitignore vendored
View File

@ -8,7 +8,7 @@ idpdb.bolt
/dist
# Project binaries.
/idp
/influx
/idpd
/ifqld
/bin

View File

@ -26,7 +26,7 @@ SOURCES := $(shell find . -name '*.go' -not -name '*_test.go')
SOURCES_NO_VENDOR := $(shell find . -path ./vendor -prune -o -name "*.go" -not -name '*_test.go' -print)
# List of binary cmds to build
CMDS := bin/idp bin/idpd bin/ifqld
CMDS := bin/influx bin/idpd bin/ifqld
# List of utilities to build as part of the build process
UTILS := bin/pigeon bin/cmpgen bin/goreleaser
@ -49,8 +49,8 @@ subdirs: $(SUBDIRS)
bin/ifqld: $(SOURCES)
$(GO_BUILD) -i -o bin/ifqld ./cmd/ifqld
bin/idp: $(SOURCES)
$(GO_BUILD) -i -o bin/idp ./cmd/idp
bin/influx: $(SOURCES)
$(GO_BUILD) -i -o bin/influx ./cmd/influx
bin/idpd: $(SOURCES)
$(GO_BUILD) -i -o bin/idpd ./cmd/idpd

View File

@ -1,63 +0,0 @@
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
func main() {
Execute()
}
var idpCmd = &cobra.Command{
Use: "idp",
Short: "IDP Client",
Run: idpF,
}
func init() {
idpCmd.AddCommand(authorizationCmd)
idpCmd.AddCommand(bucketCmd)
idpCmd.AddCommand(ifqlCmd)
idpCmd.AddCommand(organizationCmd)
idpCmd.AddCommand(userCmd)
}
// Flags contains all the CLI flag values for idp.
type Flags struct {
token string
host string
}
var flags Flags
func init() {
viper.SetEnvPrefix("IDP")
idpCmd.PersistentFlags().StringVarP(&flags.token, "token", "t", "", "API token to be used throughout client calls")
viper.BindEnv("TOKEN")
if h := viper.GetString("TOKEN"); h != "" {
flags.token = h
}
idpCmd.PersistentFlags().StringVar(&flags.host, "host", "http://localhost:9999", "HTTP address of IDP")
viper.BindEnv("HOST")
if h := viper.GetString("HOST"); h != "" {
flags.host = h
}
}
func idpF(cmd *cobra.Command, args []string) {
cmd.Usage()
}
// Execute executes the idpd command
func Execute() {
if err := idpCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

View File

@ -6,7 +6,7 @@ import (
"os"
"github.com/influxdata/platform"
"github.com/influxdata/platform/cmd/idp/internal"
"github.com/influxdata/platform/cmd/influx/internal"
"github.com/influxdata/platform/http"
"github.com/spf13/cobra"
)

View File

@ -7,7 +7,7 @@ import (
"time"
"github.com/influxdata/platform"
"github.com/influxdata/platform/cmd/idp/internal"
"github.com/influxdata/platform/cmd/influx/internal"
"github.com/influxdata/platform/http"
"github.com/spf13/cobra"
)

63
cmd/influx/main.go Normal file
View File

@ -0,0 +1,63 @@
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
func main() {
Execute()
}
var influxCmd = &cobra.Command{
Use: "influx",
Short: "Influx Client",
Run: influxF,
}
func init() {
influxCmd.AddCommand(authorizationCmd)
influxCmd.AddCommand(bucketCmd)
influxCmd.AddCommand(ifqlCmd)
influxCmd.AddCommand(organizationCmd)
influxCmd.AddCommand(userCmd)
}
// Flags contains all the CLI flag values for influx.
type Flags struct {
token string
host string
}
var flags Flags
func init() {
viper.SetEnvPrefix("INFLUX")
influxCmd.PersistentFlags().StringVarP(&flags.token, "token", "t", "", "API token to be used throughout client calls")
viper.BindEnv("TOKEN")
if h := viper.GetString("TOKEN"); h != "" {
flags.token = h
}
influxCmd.PersistentFlags().StringVar(&flags.host, "host", "http://localhost:9999", "HTTP address of Influx")
viper.BindEnv("HOST")
if h := viper.GetString("HOST"); h != "" {
flags.host = h
}
}
func influxF(cmd *cobra.Command, args []string) {
cmd.Usage()
}
// Execute executes the influx command
func Execute() {
if err := influxCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

View File

@ -6,7 +6,7 @@ import (
"os"
"github.com/influxdata/platform"
"github.com/influxdata/platform/cmd/idp/internal"
"github.com/influxdata/platform/cmd/influx/internal"
"github.com/influxdata/platform/http"
"github.com/spf13/cobra"
)

View File

@ -6,7 +6,7 @@ import (
"os"
"github.com/influxdata/platform"
"github.com/influxdata/platform/cmd/idp/internal"
"github.com/influxdata/platform/cmd/influx/internal"
"github.com/influxdata/platform/http"
"github.com/spf13/cobra"
)