commands: move kv subcommands to subdirs

This commit is contained in:
Frank Schroeder 2017-10-17 13:22:23 +02:00 committed by Frank Schröder
parent e16ef316d4
commit ce1ec000ca
12 changed files with 23 additions and 23 deletions

View File

@ -18,11 +18,11 @@ import (
"github.com/hashicorp/consul/command/keygen"
"github.com/hashicorp/consul/command/keyring"
"github.com/hashicorp/consul/command/kv"
"github.com/hashicorp/consul/command/kvdel"
"github.com/hashicorp/consul/command/kvexp"
"github.com/hashicorp/consul/command/kvget"
"github.com/hashicorp/consul/command/kvimp"
"github.com/hashicorp/consul/command/kvput"
kvdel "github.com/hashicorp/consul/command/kv/del"
kvexp "github.com/hashicorp/consul/command/kv/exp"
kvget "github.com/hashicorp/consul/command/kv/get"
kvimp "github.com/hashicorp/consul/command/kv/imp"
kvput "github.com/hashicorp/consul/command/kv/put"
"github.com/hashicorp/consul/command/leave"
"github.com/hashicorp/consul/command/lock"
"github.com/hashicorp/consul/command/maint"

View File

@ -1,4 +1,4 @@
package kvdel
package del
import (
"flag"

View File

@ -1,4 +1,4 @@
package kvdel
package del
import (
"strconv"

View File

@ -1,4 +1,4 @@
package kvexp
package exp
import (
"encoding/json"
@ -7,7 +7,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/command/flags"
"github.com/hashicorp/consul/command/kvimpexp"
"github.com/hashicorp/consul/command/kv/impexp"
"github.com/mitchellh/cli"
)
@ -72,9 +72,9 @@ func (c *cmd) Run(args []string) int {
return 1
}
exported := make([]*kvimpexp.Entry, len(pairs))
exported := make([]*impexp.Entry, len(pairs))
for i, pair := range pairs {
exported[i] = kvimpexp.ToEntry(pair)
exported[i] = impexp.ToEntry(pair)
}
marshaled, err := json.MarshalIndent(exported, "", "\t")

View File

@ -1,4 +1,4 @@
package kvexp
package exp
import (
"encoding/base64"
@ -8,7 +8,7 @@ import (
"github.com/hashicorp/consul/agent"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/command/kvimpexp"
"github.com/hashicorp/consul/command/kv/impexp"
"github.com/mitchellh/cli"
)
@ -53,7 +53,7 @@ func TestKVExportCommand_Run(t *testing.T) {
output := ui.OutputWriter.String()
var exported []*kvimpexp.Entry
var exported []*impexp.Entry
err := json.Unmarshal([]byte(output), &exported)
if err != nil {
t.Fatalf("bad: %d", code)

View File

@ -1,4 +1,4 @@
package kvget
package get
import (
"bytes"

View File

@ -1,4 +1,4 @@
package kvget
package get
import (
"encoding/base64"

View File

@ -1,4 +1,4 @@
package kvimp
package imp
import (
"bytes"
@ -13,7 +13,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/command/flags"
"github.com/hashicorp/consul/command/kvimpexp"
"github.com/hashicorp/consul/command/kv/impexp"
"github.com/mitchellh/cli"
)
@ -61,7 +61,7 @@ func (c *cmd) Run(args []string) int {
return 1
}
var entries []*kvimpexp.Entry
var entries []*impexp.Entry
if err := json.Unmarshal([]byte(data), &entries); err != nil {
c.UI.Error(fmt.Sprintf("Cannot unmarshal data: %s", err))
return 1

View File

@ -1,4 +1,4 @@
package kvimp
package imp
import (
"strings"

View File

@ -1,4 +1,4 @@
package kvimpexp
package impexp
import (
"encoding/base64"

View File

@ -1,4 +1,4 @@
package kvput
package put
import (
"bytes"

View File

@ -1,4 +1,4 @@
package kvput
package put
import (
"bytes"