mirror of https://github.com/status-im/consul.git
commands: move kv subcommands to subdirs
This commit is contained in:
parent
e16ef316d4
commit
ce1ec000ca
|
@ -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"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package kvdel
|
||||
package del
|
||||
|
||||
import (
|
||||
"flag"
|
|
@ -1,4 +1,4 @@
|
|||
package kvdel
|
||||
package del
|
||||
|
||||
import (
|
||||
"strconv"
|
|
@ -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")
|
|
@ -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)
|
|
@ -1,4 +1,4 @@
|
|||
package kvget
|
||||
package get
|
||||
|
||||
import (
|
||||
"bytes"
|
|
@ -1,4 +1,4 @@
|
|||
package kvget
|
||||
package get
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
package kvimp
|
||||
package imp
|
||||
|
||||
import (
|
||||
"strings"
|
|
@ -1,4 +1,4 @@
|
|||
package kvimpexp
|
||||
package impexp
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
|
@ -1,4 +1,4 @@
|
|||
package kvput
|
||||
package put
|
||||
|
||||
import (
|
||||
"bytes"
|
|
@ -1,4 +1,4 @@
|
|||
package kvput
|
||||
package put
|
||||
|
||||
import (
|
||||
"bytes"
|
Loading…
Reference in New Issue