Refactor common code from etcdctl (v2,v3) to pkg/corbautl.
Preparation for etcdutl split.
This commit is contained in:
parent
eae7a845a7
commit
00c6090110
@ -25,6 +25,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -55,7 +56,7 @@ func handleClusterHealth(c *cli.Context) error {
|
|||||||
|
|
||||||
tr, err := getTransport(c)
|
tr, err := getTransport(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
hc := http.Client{
|
hc := http.Client{
|
||||||
@ -67,7 +68,7 @@ func handleClusterHealth(c *cli.Context) error {
|
|||||||
ms, err := mi.List(context.TODO())
|
ms, err := mi.List(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("cluster may be unhealthy: failed to list members")
|
fmt.Println("cluster may be unhealthy: failed to list members")
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
@ -128,9 +129,9 @@ func handleClusterHealth(c *cli.Context) error {
|
|||||||
|
|
||||||
if !forever {
|
if !forever {
|
||||||
if healthyMembers == len(ms) {
|
if healthyMembers == len(ms) {
|
||||||
os.Exit(ExitSuccess)
|
os.Exit(cobrautl.ExitSuccess)
|
||||||
}
|
}
|
||||||
os.Exit(ExitClusterNotHealthy)
|
os.Exit(cobrautl.ExitClusterNotHealthy)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("\nnext check after 10 second...\n\n")
|
fmt.Printf("\nnext check after 10 second...\n\n")
|
||||||
|
@ -23,15 +23,6 @@ import (
|
|||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
ExitSuccess = iota
|
|
||||||
ExitBadArgs
|
|
||||||
ExitBadConnection
|
|
||||||
ExitBadAuth
|
|
||||||
ExitServerError
|
|
||||||
ExitClusterNotHealthy
|
|
||||||
)
|
|
||||||
|
|
||||||
func handleError(c *cli.Context, code int, err error) {
|
func handleError(c *cli.Context, code int, err error) {
|
||||||
if c.GlobalString("output") == "json" {
|
if c.GlobalString("output") == "json" {
|
||||||
if err, ok := err.(*client.Error); ok {
|
if err, ok := err.(*client.Error); ok {
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -50,7 +51,7 @@ func execWatchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
argslen := len(args)
|
argslen := len(args)
|
||||||
|
|
||||||
if argslen < 2 {
|
if argslen < 2 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key and command to exec required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key and command to exec required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -93,7 +94,7 @@ func execWatchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
for {
|
for {
|
||||||
resp, err := w.Next(context.TODO())
|
resp, err := w.Next(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if resp.Node.Dir {
|
if resp.Node.Dir {
|
||||||
fmt.Fprintf(os.Stderr, "Ignored dir %s change\n", resp.Node.Key)
|
fmt.Fprintf(os.Stderr, "Ignored dir %s change\n", resp.Node.Key)
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewGetCommand returns the CLI command for "get".
|
// NewGetCommand returns the CLI command for "get".
|
||||||
@ -43,7 +44,7 @@ func NewGetCommand() cli.Command {
|
|||||||
// getCommandFunc executes the "get" command.
|
// getCommandFunc executes the "get" command.
|
||||||
func getCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func getCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
@ -54,7 +55,7 @@ func getCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sorted, Quorum: quorum})
|
resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sorted, Quorum: quorum})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.Node.Dir {
|
if resp.Node.Dir {
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewLsCommand() cli.Command {
|
func NewLsCommand() cli.Command {
|
||||||
@ -54,7 +55,7 @@ func lsCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sort, Recursive: recursive, Quorum: quorum})
|
resp, err := ki.Get(ctx, key, &client.GetOptions{Sort: sort, Recursive: recursive, Quorum: quorum})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printLs(c, resp)
|
printLs(c, resp)
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewMakeCommand returns the CLI command for "mk".
|
// NewMakeCommand returns the CLI command for "mk".
|
||||||
@ -43,12 +44,12 @@ func NewMakeCommand() cli.Command {
|
|||||||
// mkCommandFunc executes the "mk" command.
|
// mkCommandFunc executes the "mk" command.
|
||||||
func mkCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func mkCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitBadArgs, errors.New("value required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("value required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ttl := c.Int("ttl")
|
ttl := c.Int("ttl")
|
||||||
@ -69,7 +70,7 @@ func mkCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
}
|
}
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewMakeDirCommand returns the CLI command for "mkdir".
|
// NewMakeDirCommand returns the CLI command for "mkdir".
|
||||||
@ -41,7 +42,7 @@ func NewMakeDirCommand() cli.Command {
|
|||||||
// mkdirCommandFunc executes the "mkdir" command.
|
// mkdirCommandFunc executes the "mkdir" command.
|
||||||
func mkdirCommandFunc(c *cli.Context, ki client.KeysAPI, prevExist client.PrevExistType) {
|
func mkdirCommandFunc(c *cli.Context, ki client.KeysAPI, prevExist client.PrevExistType) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
@ -51,7 +52,7 @@ func mkdirCommandFunc(c *cli.Context, ki client.KeysAPI, prevExist client.PrevEx
|
|||||||
resp, err := ki.Set(ctx, key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: prevExist})
|
resp, err := ki.Set(ctx, key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: prevExist})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if c.GlobalString("output") != "simple" {
|
if c.GlobalString("output") != "simple" {
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewRemoveCommand returns the CLI command for "rm".
|
// NewRemoveCommand returns the CLI command for "rm".
|
||||||
@ -43,7 +44,7 @@ func NewRemoveCommand() cli.Command {
|
|||||||
// rmCommandFunc executes the "rm" command.
|
// rmCommandFunc executes the "rm" command.
|
||||||
func rmCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func rmCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
recursive := c.Bool("recursive")
|
recursive := c.Bool("recursive")
|
||||||
@ -55,7 +56,7 @@ func rmCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Delete(ctx, key, &client.DeleteOptions{PrevIndex: uint64(prevIndex), PrevValue: prevValue, Dir: dir, Recursive: recursive})
|
resp, err := ki.Delete(ctx, key, &client.DeleteOptions{PrevIndex: uint64(prevIndex), PrevValue: prevValue, Dir: dir, Recursive: recursive})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if !resp.Node.Dir || c.GlobalString("output") != "simple" {
|
if !resp.Node.Dir || c.GlobalString("output") != "simple" {
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewRemoveDirCommand returns the CLI command for "rmdir".
|
// NewRemoveDirCommand returns the CLI command for "rmdir".
|
||||||
@ -37,7 +38,7 @@ func NewRemoveDirCommand() cli.Command {
|
|||||||
// rmdirCommandFunc executes the "rmdir" command.
|
// rmdirCommandFunc executes the "rmdir" command.
|
||||||
func rmdirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func rmdirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ func rmdirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Delete(ctx, key, &client.DeleteOptions{Dir: true})
|
resp, err := ki.Delete(ctx, key, &client.DeleteOptions{Dir: true})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !resp.Node.Dir || c.GlobalString("output") != "simple" {
|
if !resp.Node.Dir || c.GlobalString("output") != "simple" {
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewSetCommand returns the CLI command for "set".
|
// NewSetCommand returns the CLI command for "set".
|
||||||
@ -50,12 +51,12 @@ func NewSetCommand() cli.Command {
|
|||||||
// setCommandFunc executes the "set" command.
|
// setCommandFunc executes the "set" command.
|
||||||
func setCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func setCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitBadArgs, errors.New("value required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("value required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ttl := c.Int("ttl")
|
ttl := c.Int("ttl")
|
||||||
@ -66,7 +67,7 @@ func setCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Set(ctx, key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, PrevIndex: uint64(prevIndex), PrevValue: prevValue})
|
resp, err := ki.Set(ctx, key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, PrevIndex: uint64(prevIndex), PrevValue: prevValue})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewUpdateCommand returns the CLI command for "update".
|
// NewUpdateCommand returns the CLI command for "update".
|
||||||
@ -42,12 +43,12 @@ func NewUpdateCommand() cli.Command {
|
|||||||
// updateCommandFunc executes the "update" command.
|
// updateCommandFunc executes the "update" command.
|
||||||
func updateCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func updateCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
value, err := argOrStdin(c.Args(), os.Stdin, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitBadArgs, errors.New("value required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("value required"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ttl := c.Int("ttl")
|
ttl := c.Int("ttl")
|
||||||
@ -56,7 +57,7 @@ func updateCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Set(ctx, key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, PrevExist: client.PrevExist})
|
resp, err := ki.Set(ctx, key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, PrevExist: client.PrevExist})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewUpdateDirCommand returns the CLI command for "updatedir".
|
// NewUpdateDirCommand returns the CLI command for "updatedir".
|
||||||
@ -41,7 +42,7 @@ func NewUpdateDirCommand() cli.Command {
|
|||||||
// updatedirCommandFunc executes the "updatedir" command.
|
// updatedirCommandFunc executes the "updatedir" command.
|
||||||
func updatedirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func updatedirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
ttl := c.Int("ttl")
|
ttl := c.Int("ttl")
|
||||||
@ -49,7 +50,7 @@ func updatedirCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
resp, err := ki.Set(ctx, key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: client.PrevExist})
|
resp, err := ki.Set(ctx, key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: client.PrevExist})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if c.GlobalString("output") != "simple" {
|
if c.GlobalString("output") != "simple" {
|
||||||
printResponseKey(resp, c.GlobalString("output"))
|
printResponseKey(resp, c.GlobalString("output"))
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
|
|
||||||
"go.etcd.io/etcd/client/pkg/v3/transport"
|
"go.etcd.io/etcd/client/pkg/v3/transport"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/bgentry/speakeasy"
|
"github.com/bgentry/speakeasy"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@ -242,10 +243,10 @@ func mustNewClient(c *cli.Context) client.Client {
|
|||||||
if err == client.ErrNoEndpoints {
|
if err == client.ErrNoEndpoints {
|
||||||
fmt.Fprintf(os.Stderr, "etcd cluster has no published client endpoints.\n")
|
fmt.Fprintf(os.Stderr, "etcd cluster has no published client endpoints.\n")
|
||||||
fmt.Fprintf(os.Stderr, "Try '--no-sync' if you want to access non-published client endpoints(%s).\n", strings.Join(hc.Endpoints(), ","))
|
fmt.Fprintf(os.Stderr, "Try '--no-sync' if you want to access non-published client endpoints(%s).\n", strings.Join(hc.Endpoints(), ","))
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if isConnectionError(err) {
|
if isConnectionError(err) {
|
||||||
handleError(c, ExitBadConnection, err)
|
handleError(c, cobrautl.ExitBadConnection, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if debug {
|
if debug {
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -47,7 +48,7 @@ func NewWatchCommand() cli.Command {
|
|||||||
// watchCommandFunc executes the "watch" command.
|
// watchCommandFunc executes the "watch" command.
|
||||||
func watchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
func watchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||||
if len(c.Args()) == 0 {
|
if len(c.Args()) == 0 {
|
||||||
handleError(c, ExitBadArgs, errors.New("key required"))
|
handleError(c, cobrautl.ExitBadArgs, errors.New("key required"))
|
||||||
}
|
}
|
||||||
key := c.Args()[0]
|
key := c.Args()[0]
|
||||||
recursive := c.Bool("recursive")
|
recursive := c.Bool("recursive")
|
||||||
@ -68,7 +69,7 @@ func watchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
|||||||
for !stop {
|
for !stop {
|
||||||
resp, err := w.Next(context.TODO())
|
resp, err := w.Next(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
handleError(c, ExitServerError, err)
|
handleError(c, cobrautl.ExitServerError, err)
|
||||||
}
|
}
|
||||||
if resp.Node.Dir {
|
if resp.Node.Dir {
|
||||||
continue
|
continue
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewAlarmCommand returns the cobra command for "alarm".
|
// NewAlarmCommand returns the cobra command for "alarm".
|
||||||
@ -46,13 +47,13 @@ func NewAlarmDisarmCommand() *cobra.Command {
|
|||||||
// alarmDisarmCommandFunc executes the "alarm disarm" command.
|
// alarmDisarmCommandFunc executes the "alarm disarm" command.
|
||||||
func alarmDisarmCommandFunc(cmd *cobra.Command, args []string) {
|
func alarmDisarmCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("alarm disarm command accepts no arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("alarm disarm command accepts no arguments"))
|
||||||
}
|
}
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
resp, err := mustClientFromCmd(cmd).AlarmDisarm(ctx, &v3.AlarmMember{})
|
resp, err := mustClientFromCmd(cmd).AlarmDisarm(ctx, &v3.AlarmMember{})
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.Alarm(*resp)
|
display.Alarm(*resp)
|
||||||
}
|
}
|
||||||
@ -69,13 +70,13 @@ func NewAlarmListCommand() *cobra.Command {
|
|||||||
// alarmListCommandFunc executes the "alarm list" command.
|
// alarmListCommandFunc executes the "alarm list" command.
|
||||||
func alarmListCommandFunc(cmd *cobra.Command, args []string) {
|
func alarmListCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("alarm list command accepts no arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("alarm list command accepts no arguments"))
|
||||||
}
|
}
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
resp, err := mustClientFromCmd(cmd).AlarmList(ctx)
|
resp, err := mustClientFromCmd(cmd).AlarmList(ctx)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.Alarm(*resp)
|
display.Alarm(*resp)
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewAuthCommand returns the cobra command for "auth".
|
// NewAuthCommand returns the cobra command for "auth".
|
||||||
@ -46,14 +47,14 @@ func newAuthStatusCommand() *cobra.Command {
|
|||||||
// authStatusCommandFunc executes the "auth status" command.
|
// authStatusCommandFunc executes the "auth status" command.
|
||||||
func authStatusCommandFunc(cmd *cobra.Command, args []string) {
|
func authStatusCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("auth status command does not accept any arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("auth status command does not accept any arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
result, err := mustClientFromCmd(cmd).Auth.AuthStatus(ctx)
|
result, err := mustClientFromCmd(cmd).Auth.AuthStatus(ctx)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.AuthStatus(*result)
|
display.AuthStatus(*result)
|
||||||
@ -70,7 +71,7 @@ func newAuthEnableCommand() *cobra.Command {
|
|||||||
// authEnableCommandFunc executes the "auth enable" command.
|
// authEnableCommandFunc executes the "auth enable" command.
|
||||||
func authEnableCommandFunc(cmd *cobra.Command, args []string) {
|
func authEnableCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("auth enable command does not accept any arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("auth enable command does not accept any arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
@ -91,7 +92,7 @@ func authEnableCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Authentication Enabled")
|
fmt.Println("Authentication Enabled")
|
||||||
@ -108,14 +109,14 @@ func newAuthDisableCommand() *cobra.Command {
|
|||||||
// authDisableCommandFunc executes the "auth disable" command.
|
// authDisableCommandFunc executes the "auth disable" command.
|
||||||
func authDisableCommandFunc(cmd *cobra.Command, args []string) {
|
func authDisableCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("auth disable command does not accept any arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("auth disable command does not accept any arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
_, err := mustClientFromCmd(cmd).Auth.AuthDisable(ctx)
|
_, err := mustClientFromCmd(cmd).Auth.AuthDisable(ctx)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Authentication Disabled")
|
fmt.Println("Authentication Disabled")
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
"go.etcd.io/etcd/pkg/v3/report"
|
"go.etcd.io/etcd/pkg/v3/report"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -144,7 +145,7 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
model, ok := checkPerfAlias[checkPerfLoad]
|
model, ok := checkPerfAlias[checkPerfLoad]
|
||||||
if !ok {
|
if !ok {
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("unknown load option %v", checkPerfLoad))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("unknown load option %v", checkPerfLoad))
|
||||||
}
|
}
|
||||||
cfg := checkPerfCfgMap[model]
|
cfg := checkPerfCfgMap[model]
|
||||||
|
|
||||||
@ -166,10 +167,10 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := clients[0].Get(gctx, checkPerfPrefix, v3.WithPrefix(), v3.WithLimit(1))
|
resp, err := clients[0].Get(gctx, checkPerfPrefix, v3.WithPrefix(), v3.WithLimit(1))
|
||||||
gcancel()
|
gcancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
if len(resp.Kvs) > 0 {
|
if len(resp.Kvs) > 0 {
|
||||||
ExitWithError(ExitInvalidInput, fmt.Errorf("prefix %q has keys. Delete with 'etcdctl del --prefix %s' first", checkPerfPrefix, checkPerfPrefix))
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, fmt.Errorf("prefix %q has keys. Delete with 'etcdctl del --prefix %s' first", checkPerfPrefix, checkPerfPrefix))
|
||||||
}
|
}
|
||||||
|
|
||||||
ksize, vsize := 256, 1024
|
ksize, vsize := 256, 1024
|
||||||
@ -258,7 +259,7 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
|
|||||||
fmt.Println("PASS")
|
fmt.Println("PASS")
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("FAIL")
|
fmt.Println("FAIL")
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,7 +319,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
model, ok := checkDatascaleAlias[checkDatascaleLoad]
|
model, ok := checkDatascaleAlias[checkDatascaleLoad]
|
||||||
if !ok {
|
if !ok {
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("unknown load option %v", checkDatascaleLoad))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("unknown load option %v", checkDatascaleLoad))
|
||||||
}
|
}
|
||||||
cfg := checkDatascaleCfgMap[model]
|
cfg := checkDatascaleCfgMap[model]
|
||||||
|
|
||||||
@ -333,7 +334,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
// get endpoints
|
// get endpoints
|
||||||
eps, errEndpoints := endpointsFromCmd(cmd)
|
eps, errEndpoints := endpointsFromCmd(cmd)
|
||||||
if errEndpoints != nil {
|
if errEndpoints != nil {
|
||||||
ExitWithError(ExitError, errEndpoints)
|
cobrautl.ExitWithError(cobrautl.ExitError, errEndpoints)
|
||||||
}
|
}
|
||||||
|
|
||||||
sec := secureCfgFromCmd(cmd)
|
sec := secureCfgFromCmd(cmd)
|
||||||
@ -342,10 +343,10 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := clients[0].Get(ctx, checkDatascalePrefix, v3.WithPrefix(), v3.WithLimit(1))
|
resp, err := clients[0].Get(ctx, checkDatascalePrefix, v3.WithPrefix(), v3.WithLimit(1))
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
if len(resp.Kvs) > 0 {
|
if len(resp.Kvs) > 0 {
|
||||||
ExitWithError(ExitInvalidInput, fmt.Errorf("prefix %q has keys. Delete with etcdctl del --prefix %s first", checkDatascalePrefix, checkDatascalePrefix))
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, fmt.Errorf("prefix %q has keys. Delete with etcdctl del --prefix %s first", checkDatascalePrefix, checkDatascalePrefix))
|
||||||
}
|
}
|
||||||
|
|
||||||
ksize, vsize := 512, 512
|
ksize, vsize := 512, 512
|
||||||
@ -359,7 +360,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
bytesBefore := endpointMemoryMetrics(eps[0], sec)
|
bytesBefore := endpointMemoryMetrics(eps[0], sec)
|
||||||
if bytesBefore == 0 {
|
if bytesBefore == 0 {
|
||||||
fmt.Println("FAIL: Could not read process_resident_memory_bytes before the put operations.")
|
fmt.Println("FAIL: Could not read process_resident_memory_bytes before the put operations.")
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(fmt.Sprintf("Start data scale check for work load [%v key-value pairs, %v bytes per key-value, %v concurrent clients].", cfg.limit, cfg.kvSize, cfg.clients))
|
fmt.Println(fmt.Sprintf("Start data scale check for work load [%v key-value pairs, %v bytes per key-value, %v concurrent clients].", cfg.limit, cfg.kvSize, cfg.clients))
|
||||||
@ -397,7 +398,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
bytesAfter := endpointMemoryMetrics(eps[0], sec)
|
bytesAfter := endpointMemoryMetrics(eps[0], sec)
|
||||||
if bytesAfter == 0 {
|
if bytesAfter == 0 {
|
||||||
fmt.Println("FAIL: Could not read process_resident_memory_bytes after the put operations.")
|
fmt.Println("FAIL: Could not read process_resident_memory_bytes after the put operations.")
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the created kv pairs
|
// delete the created kv pairs
|
||||||
@ -405,7 +406,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
dresp, derr := clients[0].Delete(ctx, checkDatascalePrefix, v3.WithPrefix())
|
dresp, derr := clients[0].Delete(ctx, checkDatascalePrefix, v3.WithPrefix())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
if derr != nil {
|
if derr != nil {
|
||||||
ExitWithError(ExitError, derr)
|
cobrautl.ExitWithError(cobrautl.ExitError, derr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if autoCompact {
|
if autoCompact {
|
||||||
@ -420,7 +421,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
if bytesAfter == 0 {
|
if bytesAfter == 0 {
|
||||||
fmt.Println("FAIL: Could not read process_resident_memory_bytes after the put operations.")
|
fmt.Println("FAIL: Could not read process_resident_memory_bytes after the put operations.")
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
|
|
||||||
bytesUsed := bytesAfter - bytesBefore
|
bytesUsed := bytesAfter - bytesBefore
|
||||||
@ -431,7 +432,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
|
|||||||
for k, v := range s.ErrorDist {
|
for k, v := range s.ErrorDist {
|
||||||
fmt.Printf("FAIL: ERROR(%v) -> %d\n", k, v)
|
fmt.Printf("FAIL: ERROR(%v) -> %d\n", k, v)
|
||||||
}
|
}
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(fmt.Sprintf("PASS: Approximate system memory used : %v MB.", strconv.FormatFloat(mbUsed, 'f', 2, 64)))
|
fmt.Println(fmt.Sprintf("PASS: Approximate system memory used : %v MB.", strconv.FormatFloat(mbUsed, 'f', 2, 64)))
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var compactPhysical bool
|
var compactPhysical bool
|
||||||
@ -38,12 +39,12 @@ func NewCompactionCommand() *cobra.Command {
|
|||||||
// compactionCommandFunc executes the "compaction" command.
|
// compactionCommandFunc executes the "compaction" command.
|
||||||
func compactionCommandFunc(cmd *cobra.Command, args []string) {
|
func compactionCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("compaction command needs 1 argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("compaction command needs 1 argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
rev, err := strconv.ParseInt(args[0], 10, 64)
|
rev, err := strconv.ParseInt(args[0], 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var opts []clientv3.CompactOption
|
var opts []clientv3.CompactOption
|
||||||
@ -56,7 +57,7 @@ func compactionCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
_, cerr := c.Compact(ctx, rev, opts...)
|
_, cerr := c.Compact(ctx, rev, opts...)
|
||||||
cancel()
|
cancel()
|
||||||
if cerr != nil {
|
if cerr != nil {
|
||||||
ExitWithError(ExitError, cerr)
|
cobrautl.ExitWithError(cobrautl.ExitError, cerr)
|
||||||
}
|
}
|
||||||
fmt.Println("compacted revision", rev)
|
fmt.Println("compacted revision", rev)
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
"go.etcd.io/etcd/server/v3/mvcc/backend"
|
"go.etcd.io/etcd/server/v3/mvcc/backend"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ func defragCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
err := defragData(defragDataDir)
|
err := defragData(defragDataDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to defragment etcd data[%s] (%v)\n", defragDataDir, err)
|
fmt.Fprintf(os.Stderr, "Failed to defragment etcd data[%s] (%v)\n", defragDataDir, err)
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -65,7 +66,7 @@ func defragCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if failures != 0 {
|
if failures != 0 {
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -48,25 +49,25 @@ func delCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).Delete(ctx, key, opts...)
|
resp, err := mustClientFromCmd(cmd).Delete(ctx, key, opts...)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.Del(*resp)
|
display.Del(*resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDelOp(args []string) (string, []clientv3.OpOption) {
|
func getDelOp(args []string) (string, []clientv3.OpOption) {
|
||||||
if len(args) == 0 || len(args) > 2 {
|
if len(args) == 0 || len(args) > 2 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("del command needs one argument as key and an optional argument as range_end"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("del command needs one argument as key and an optional argument as range_end"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if delPrefix && delFromKey {
|
if delPrefix && delFromKey {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("`--prefix` and `--from-key` cannot be set at the same time, choose one"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("`--prefix` and `--from-key` cannot be set at the same time, choose one"))
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := []clientv3.OpOption{}
|
opts := []clientv3.OpOption{}
|
||||||
key := args[0]
|
key := args[0]
|
||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
if delPrefix || delFromKey {
|
if delPrefix || delFromKey {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("too many arguments, only accept one argument when `--prefix` or `--from-key` is set"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("too many arguments, only accept one argument when `--prefix` or `--from-key` is set"))
|
||||||
}
|
}
|
||||||
opts = append(opts, clientv3.WithRange(args[1]))
|
opts = append(opts, clientv3.WithRange(args[1]))
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
|
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
"go.etcd.io/etcd/client/v3/concurrency"
|
"go.etcd.io/etcd/client/v3/concurrency"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -44,24 +45,24 @@ func NewElectCommand() *cobra.Command {
|
|||||||
|
|
||||||
func electCommandFunc(cmd *cobra.Command, args []string) {
|
func electCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 && len(args) != 2 {
|
if len(args) != 1 && len(args) != 2 {
|
||||||
ExitWithError(ExitBadArgs, errors.New("elect takes one election name argument and an optional proposal argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("elect takes one election name argument and an optional proposal argument"))
|
||||||
}
|
}
|
||||||
c := mustClientFromCmd(cmd)
|
c := mustClientFromCmd(cmd)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if len(args) == 1 {
|
if len(args) == 1 {
|
||||||
if !electListen {
|
if !electListen {
|
||||||
ExitWithError(ExitBadArgs, errors.New("no proposal argument but -l not set"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("no proposal argument but -l not set"))
|
||||||
}
|
}
|
||||||
err = observe(c, args[0])
|
err = observe(c, args[0])
|
||||||
} else {
|
} else {
|
||||||
if electListen {
|
if electListen {
|
||||||
ExitWithError(ExitBadArgs, errors.New("proposal given but -l is set"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("proposal given but -l is set"))
|
||||||
}
|
}
|
||||||
err = campaign(c, args[0], args[1])
|
err = campaign(c, args[0], args[1])
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"go.etcd.io/etcd/api/v3/etcdserverpb"
|
"go.etcd.io/etcd/api/v3/etcdserverpb"
|
||||||
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
"go.etcd.io/etcd/pkg/v3/flags"
|
"go.etcd.io/etcd/pkg/v3/flags"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -89,7 +90,7 @@ type epHealth struct {
|
|||||||
func epHealthCommandFunc(cmd *cobra.Command, args []string) {
|
func epHealthCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
lg, err := zap.NewProduction()
|
lg, err := zap.NewProduction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
flags.SetPflagsFromEnv(lg, "ETCDCTL", cmd.InheritedFlags())
|
flags.SetPflagsFromEnv(lg, "ETCDCTL", cmd.InheritedFlags())
|
||||||
initDisplayFromCmd(cmd)
|
initDisplayFromCmd(cmd)
|
||||||
@ -103,7 +104,7 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
for _, ep := range endpointsFromCluster(cmd) {
|
for _, ep := range endpointsFromCluster(cmd) {
|
||||||
cfg, err := newClientCfg([]string{ep}, dt, ka, kat, sec, auth)
|
cfg, err := newClientCfg([]string{ep}, dt, ka, kat, sec, auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
cfgs = append(cfgs, cfg)
|
cfgs = append(cfgs, cfg)
|
||||||
}
|
}
|
||||||
@ -172,7 +173,7 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
display.EndpointHealth(healthList)
|
display.EndpointHealth(healthList)
|
||||||
if errs {
|
if errs {
|
||||||
ExitWithError(ExitError, fmt.Errorf("unhealthy cluster"))
|
cobrautl.ExitWithError(cobrautl.ExitError, fmt.Errorf("unhealthy cluster"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +202,7 @@ func epStatusCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
display.EndpointStatus(statusList)
|
display.EndpointStatus(statusList)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Exit(ExitError)
|
os.Exit(cobrautl.ExitError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +231,7 @@ func epHashKVCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
display.EndpointHashKV(hashList)
|
display.EndpointHashKV(hashList)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +239,7 @@ func endpointsFromCluster(cmd *cobra.Command) []string {
|
|||||||
if !epClusterEndpoints {
|
if !epClusterEndpoints {
|
||||||
endpoints, err := cmd.Flags().GetStringSlice("endpoints")
|
endpoints, err := cmd.Flags().GetStringSlice("endpoints")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return endpoints
|
return endpoints
|
||||||
}
|
}
|
||||||
@ -249,17 +250,17 @@ func endpointsFromCluster(cmd *cobra.Command) []string {
|
|||||||
kat := keepAliveTimeoutFromCmd(cmd)
|
kat := keepAliveTimeoutFromCmd(cmd)
|
||||||
eps, err := endpointsFromCmd(cmd)
|
eps, err := endpointsFromCmd(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
// exclude auth for not asking needless password (MemberList() doesn't need authentication)
|
// exclude auth for not asking needless password (MemberList() doesn't need authentication)
|
||||||
|
|
||||||
cfg, err := newClientCfg(eps, dt, ka, kat, sec, nil)
|
cfg, err := newClientCfg(eps, dt, ka, kat, sec, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
c, err := v3.New(*cfg)
|
c, err := v3.New(*cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
@ -270,7 +271,7 @@ func endpointsFromCluster(cmd *cobra.Command) []string {
|
|||||||
membs, err := c.MemberList(ctx)
|
membs, err := c.MemberList(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("failed to fetch endpoints from etcd cluster member list: %v", err)
|
err = fmt.Errorf("failed to fetch endpoints from etcd cluster member list: %v", err)
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret := []string{}
|
ret := []string{}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -63,19 +64,19 @@ func getCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).Get(ctx, key, opts...)
|
resp, err := mustClientFromCmd(cmd).Get(ctx, key, opts...)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if getCountOnly {
|
if getCountOnly {
|
||||||
if _, fields := display.(*fieldsPrinter); !fields {
|
if _, fields := display.(*fieldsPrinter); !fields {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("--count-only is only for `--write-out=fields`"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("--count-only is only for `--write-out=fields`"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if printValueOnly {
|
if printValueOnly {
|
||||||
dp, simple := (display).(*simplePrinter)
|
dp, simple := (display).(*simplePrinter)
|
||||||
if !simple {
|
if !simple {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("print-value-only is only for `--write-out=simple`"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("print-value-only is only for `--write-out=simple`"))
|
||||||
}
|
}
|
||||||
dp.valueOnly = true
|
dp.valueOnly = true
|
||||||
}
|
}
|
||||||
@ -84,15 +85,15 @@ func getCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
func getGetOp(args []string) (string, []clientv3.OpOption) {
|
func getGetOp(args []string) (string, []clientv3.OpOption) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("get command needs one argument as key and an optional argument as range_end"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("get command needs one argument as key and an optional argument as range_end"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if getPrefix && getFromKey {
|
if getPrefix && getFromKey {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("`--prefix` and `--from-key` cannot be set at the same time, choose one"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("`--prefix` and `--from-key` cannot be set at the same time, choose one"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if getKeysOnly && getCountOnly {
|
if getKeysOnly && getCountOnly {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("`--keys-only` and `--count-only` cannot be set at the same time, choose one"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("`--keys-only` and `--count-only` cannot be set at the same time, choose one"))
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := []clientv3.OpOption{}
|
opts := []clientv3.OpOption{}
|
||||||
@ -101,13 +102,13 @@ func getGetOp(args []string) (string, []clientv3.OpOption) {
|
|||||||
opts = append(opts, clientv3.WithSerializable())
|
opts = append(opts, clientv3.WithSerializable())
|
||||||
case "l":
|
case "l":
|
||||||
default:
|
default:
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("unknown consistency flag %q", getConsistency))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("unknown consistency flag %q", getConsistency))
|
||||||
}
|
}
|
||||||
|
|
||||||
key := args[0]
|
key := args[0]
|
||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
if getPrefix || getFromKey {
|
if getPrefix || getFromKey {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("too many arguments, only accept one argument when `--prefix` or `--from-key` is set"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("too many arguments, only accept one argument when `--prefix` or `--from-key` is set"))
|
||||||
}
|
}
|
||||||
opts = append(opts, clientv3.WithRange(args[1]))
|
opts = append(opts, clientv3.WithRange(args[1]))
|
||||||
}
|
}
|
||||||
@ -127,7 +128,7 @@ func getGetOp(args []string) (string, []clientv3.OpOption) {
|
|||||||
case sortOrder == "":
|
case sortOrder == "":
|
||||||
// nothing
|
// nothing
|
||||||
default:
|
default:
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("bad sort order %v", getSortOrder))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("bad sort order %v", getSortOrder))
|
||||||
}
|
}
|
||||||
|
|
||||||
sortByTarget := clientv3.SortByKey
|
sortByTarget := clientv3.SortByKey
|
||||||
@ -146,7 +147,7 @@ func getGetOp(args []string) (string, []clientv3.OpOption) {
|
|||||||
case sortTarget == "":
|
case sortTarget == "":
|
||||||
// nothing
|
// nothing
|
||||||
default:
|
default:
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("bad sort target %v", getSortTarget))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("bad sort target %v", getSortTarget))
|
||||||
}
|
}
|
||||||
|
|
||||||
opts = append(opts, clientv3.WithSort(sortByTarget, sortByOrder))
|
opts = append(opts, clientv3.WithSort(sortByTarget, sortByOrder))
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
"go.etcd.io/etcd/client/pkg/v3/srv"
|
"go.etcd.io/etcd/client/pkg/v3/srv"
|
||||||
"go.etcd.io/etcd/client/pkg/v3/transport"
|
"go.etcd.io/etcd/client/pkg/v3/transport"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
"go.etcd.io/etcd/pkg/v3/flags"
|
"go.etcd.io/etcd/pkg/v3/flags"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -86,14 +87,14 @@ var display printer = &simplePrinter{}
|
|||||||
func initDisplayFromCmd(cmd *cobra.Command) {
|
func initDisplayFromCmd(cmd *cobra.Command) {
|
||||||
isHex, err := cmd.Flags().GetBool("hex")
|
isHex, err := cmd.Flags().GetBool("hex")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
outputType, err := cmd.Flags().GetString("write-out")
|
outputType, err := cmd.Flags().GetString("write-out")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
if display = NewPrinter(outputType, isHex); display == nil {
|
if display = NewPrinter(outputType, isHex); display == nil {
|
||||||
ExitWithError(ExitBadFeature, errors.New("unsupported output format"))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, errors.New("unsupported output format"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ func (*discardValue) Type() string { return "" }
|
|||||||
func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
|
func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
|
||||||
lg, err := zap.NewProduction()
|
lg, err := zap.NewProduction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
fs := cmd.InheritedFlags()
|
fs := cmd.InheritedFlags()
|
||||||
if strings.HasPrefix(cmd.Use, "watch") {
|
if strings.HasPrefix(cmd.Use, "watch") {
|
||||||
@ -128,7 +129,7 @@ func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
|
|||||||
|
|
||||||
debug, err := cmd.Flags().GetBool("debug")
|
debug, err := cmd.Flags().GetBool("debug")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
if debug {
|
if debug {
|
||||||
grpclog.SetLoggerV2(grpclog.NewLoggerV2WithVerbosity(os.Stderr, os.Stderr, os.Stderr, 4))
|
grpclog.SetLoggerV2(grpclog.NewLoggerV2WithVerbosity(os.Stderr, os.Stderr, os.Stderr, 4))
|
||||||
@ -146,7 +147,7 @@ func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
|
|||||||
cfg := &clientConfig{}
|
cfg := &clientConfig{}
|
||||||
cfg.endpoints, err = endpointsFromCmd(cmd)
|
cfg.endpoints, err = endpointsFromCmd(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.dialTimeout = dialTimeoutFromCmd(cmd)
|
cfg.dialTimeout = dialTimeoutFromCmd(cmd)
|
||||||
@ -164,7 +165,7 @@ func mustClientCfgFromCmd(cmd *cobra.Command) *clientv3.Config {
|
|||||||
cc := clientConfigFromCmd(cmd)
|
cc := clientConfigFromCmd(cmd)
|
||||||
cfg, err := newClientCfg(cc.endpoints, cc.dialTimeout, cc.keepAliveTime, cc.keepAliveTimeout, cc.scfg, cc.acfg)
|
cfg, err := newClientCfg(cc.endpoints, cc.dialTimeout, cc.keepAliveTime, cc.keepAliveTimeout, cc.scfg, cc.acfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
@ -177,12 +178,12 @@ func mustClientFromCmd(cmd *cobra.Command) *clientv3.Client {
|
|||||||
func (cc *clientConfig) mustClient() *clientv3.Client {
|
func (cc *clientConfig) mustClient() *clientv3.Client {
|
||||||
cfg, err := newClientCfg(cc.endpoints, cc.dialTimeout, cc.keepAliveTime, cc.keepAliveTimeout, cc.scfg, cc.acfg)
|
cfg, err := newClientCfg(cc.endpoints, cc.dialTimeout, cc.keepAliveTime, cc.keepAliveTimeout, cc.scfg, cc.acfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := clientv3.New(*cfg)
|
client, err := clientv3.New(*cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadConnection, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return client
|
return client
|
||||||
@ -263,7 +264,7 @@ func argOrStdin(args []string, stdin io.Reader, i int) (string, error) {
|
|||||||
func dialTimeoutFromCmd(cmd *cobra.Command) time.Duration {
|
func dialTimeoutFromCmd(cmd *cobra.Command) time.Duration {
|
||||||
dialTimeout, err := cmd.Flags().GetDuration("dial-timeout")
|
dialTimeout, err := cmd.Flags().GetDuration("dial-timeout")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return dialTimeout
|
return dialTimeout
|
||||||
}
|
}
|
||||||
@ -271,7 +272,7 @@ func dialTimeoutFromCmd(cmd *cobra.Command) time.Duration {
|
|||||||
func keepAliveTimeFromCmd(cmd *cobra.Command) time.Duration {
|
func keepAliveTimeFromCmd(cmd *cobra.Command) time.Duration {
|
||||||
keepAliveTime, err := cmd.Flags().GetDuration("keepalive-time")
|
keepAliveTime, err := cmd.Flags().GetDuration("keepalive-time")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return keepAliveTime
|
return keepAliveTime
|
||||||
}
|
}
|
||||||
@ -279,7 +280,7 @@ func keepAliveTimeFromCmd(cmd *cobra.Command) time.Duration {
|
|||||||
func keepAliveTimeoutFromCmd(cmd *cobra.Command) time.Duration {
|
func keepAliveTimeoutFromCmd(cmd *cobra.Command) time.Duration {
|
||||||
keepAliveTimeout, err := cmd.Flags().GetDuration("keepalive-timeout")
|
keepAliveTimeout, err := cmd.Flags().GetDuration("keepalive-timeout")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return keepAliveTimeout
|
return keepAliveTimeout
|
||||||
}
|
}
|
||||||
@ -308,7 +309,7 @@ func secureCfgFromCmd(cmd *cobra.Command) *secureCfg {
|
|||||||
func insecureTransportFromCmd(cmd *cobra.Command) bool {
|
func insecureTransportFromCmd(cmd *cobra.Command) bool {
|
||||||
insecureTr, err := cmd.Flags().GetBool("insecure-transport")
|
insecureTr, err := cmd.Flags().GetBool("insecure-transport")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return insecureTr
|
return insecureTr
|
||||||
}
|
}
|
||||||
@ -316,7 +317,7 @@ func insecureTransportFromCmd(cmd *cobra.Command) bool {
|
|||||||
func insecureSkipVerifyFromCmd(cmd *cobra.Command) bool {
|
func insecureSkipVerifyFromCmd(cmd *cobra.Command) bool {
|
||||||
skipVerify, err := cmd.Flags().GetBool("insecure-skip-tls-verify")
|
skipVerify, err := cmd.Flags().GetBool("insecure-skip-tls-verify")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return skipVerify
|
return skipVerify
|
||||||
}
|
}
|
||||||
@ -324,21 +325,21 @@ func insecureSkipVerifyFromCmd(cmd *cobra.Command) bool {
|
|||||||
func keyAndCertFromCmd(cmd *cobra.Command) (cert, key, cacert string) {
|
func keyAndCertFromCmd(cmd *cobra.Command) (cert, key, cacert string) {
|
||||||
var err error
|
var err error
|
||||||
if cert, err = cmd.Flags().GetString("cert"); err != nil {
|
if cert, err = cmd.Flags().GetString("cert"); err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
} else if cert == "" && cmd.Flags().Changed("cert") {
|
} else if cert == "" && cmd.Flags().Changed("cert") {
|
||||||
ExitWithError(ExitBadArgs, errors.New("empty string is passed to --cert option"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("empty string is passed to --cert option"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if key, err = cmd.Flags().GetString("key"); err != nil {
|
if key, err = cmd.Flags().GetString("key"); err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
} else if key == "" && cmd.Flags().Changed("key") {
|
} else if key == "" && cmd.Flags().Changed("key") {
|
||||||
ExitWithError(ExitBadArgs, errors.New("empty string is passed to --key option"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("empty string is passed to --key option"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if cacert, err = cmd.Flags().GetString("cacert"); err != nil {
|
if cacert, err = cmd.Flags().GetString("cacert"); err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
} else if cacert == "" && cmd.Flags().Changed("cacert") {
|
} else if cacert == "" && cmd.Flags().Changed("cacert") {
|
||||||
ExitWithError(ExitBadArgs, errors.New("empty string is passed to --cacert option"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("empty string is passed to --cacert option"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return cert, key, cacert
|
return cert, key, cacert
|
||||||
@ -347,11 +348,11 @@ func keyAndCertFromCmd(cmd *cobra.Command) (cert, key, cacert string) {
|
|||||||
func authCfgFromCmd(cmd *cobra.Command) *authCfg {
|
func authCfgFromCmd(cmd *cobra.Command) *authCfg {
|
||||||
userFlag, err := cmd.Flags().GetString("user")
|
userFlag, err := cmd.Flags().GetString("user")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
passwordFlag, err := cmd.Flags().GetString("password")
|
passwordFlag, err := cmd.Flags().GetString("password")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if userFlag == "" {
|
if userFlag == "" {
|
||||||
@ -366,7 +367,7 @@ func authCfgFromCmd(cmd *cobra.Command) *authCfg {
|
|||||||
cfg.username = userFlag
|
cfg.username = userFlag
|
||||||
cfg.password, err = speakeasy.Ask("Password: ")
|
cfg.password, err = speakeasy.Ask("Password: ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfg.username = splitted[0]
|
cfg.username = splitted[0]
|
||||||
@ -383,7 +384,7 @@ func authCfgFromCmd(cmd *cobra.Command) *authCfg {
|
|||||||
func insecureDiscoveryFromCmd(cmd *cobra.Command) bool {
|
func insecureDiscoveryFromCmd(cmd *cobra.Command) bool {
|
||||||
discovery, err := cmd.Flags().GetBool("insecure-discovery")
|
discovery, err := cmd.Flags().GetBool("insecure-discovery")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return discovery
|
return discovery
|
||||||
}
|
}
|
||||||
@ -391,7 +392,7 @@ func insecureDiscoveryFromCmd(cmd *cobra.Command) bool {
|
|||||||
func discoverySrvFromCmd(cmd *cobra.Command) string {
|
func discoverySrvFromCmd(cmd *cobra.Command) string {
|
||||||
domainStr, err := cmd.Flags().GetString("discovery-srv")
|
domainStr, err := cmd.Flags().GetString("discovery-srv")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
return domainStr
|
return domainStr
|
||||||
}
|
}
|
||||||
@ -399,7 +400,7 @@ func discoverySrvFromCmd(cmd *cobra.Command) string {
|
|||||||
func discoveryDNSClusterServiceNameFromCmd(cmd *cobra.Command) string {
|
func discoveryDNSClusterServiceNameFromCmd(cmd *cobra.Command) string {
|
||||||
serviceNameStr, err := cmd.Flags().GetString("discovery-srv-name")
|
serviceNameStr, err := cmd.Flags().GetString("discovery-srv-name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
return serviceNameStr
|
return serviceNameStr
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -55,19 +56,19 @@ func NewLeaseGrantCommand() *cobra.Command {
|
|||||||
// leaseGrantCommandFunc executes the "lease grant" command.
|
// leaseGrantCommandFunc executes the "lease grant" command.
|
||||||
func leaseGrantCommandFunc(cmd *cobra.Command, args []string) {
|
func leaseGrantCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("lease grant command needs TTL argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("lease grant command needs TTL argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
ttl, err := strconv.ParseInt(args[0], 10, 64)
|
ttl, err := strconv.ParseInt(args[0], 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad TTL (%v)", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad TTL (%v)", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
resp, err := mustClientFromCmd(cmd).Grant(ctx, ttl)
|
resp, err := mustClientFromCmd(cmd).Grant(ctx, ttl)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, fmt.Errorf("failed to grant lease (%v)", err))
|
cobrautl.ExitWithError(cobrautl.ExitError, fmt.Errorf("failed to grant lease (%v)", err))
|
||||||
}
|
}
|
||||||
display.Grant(*resp)
|
display.Grant(*resp)
|
||||||
}
|
}
|
||||||
@ -87,7 +88,7 @@ func NewLeaseRevokeCommand() *cobra.Command {
|
|||||||
// leaseRevokeCommandFunc executes the "lease grant" command.
|
// leaseRevokeCommandFunc executes the "lease grant" command.
|
||||||
func leaseRevokeCommandFunc(cmd *cobra.Command, args []string) {
|
func leaseRevokeCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("lease revoke command needs 1 argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("lease revoke command needs 1 argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
id := leaseFromArgs(args[0])
|
id := leaseFromArgs(args[0])
|
||||||
@ -95,7 +96,7 @@ func leaseRevokeCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).Revoke(ctx, id)
|
resp, err := mustClientFromCmd(cmd).Revoke(ctx, id)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, fmt.Errorf("failed to revoke lease (%v)", err))
|
cobrautl.ExitWithError(cobrautl.ExitError, fmt.Errorf("failed to revoke lease (%v)", err))
|
||||||
}
|
}
|
||||||
display.Revoke(id, *resp)
|
display.Revoke(id, *resp)
|
||||||
}
|
}
|
||||||
@ -118,7 +119,7 @@ func NewLeaseTimeToLiveCommand() *cobra.Command {
|
|||||||
// leaseTimeToLiveCommandFunc executes the "lease timetolive" command.
|
// leaseTimeToLiveCommandFunc executes the "lease timetolive" command.
|
||||||
func leaseTimeToLiveCommandFunc(cmd *cobra.Command, args []string) {
|
func leaseTimeToLiveCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("lease timetolive command needs lease ID as argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("lease timetolive command needs lease ID as argument"))
|
||||||
}
|
}
|
||||||
var opts []v3.LeaseOption
|
var opts []v3.LeaseOption
|
||||||
if timeToLiveKeys {
|
if timeToLiveKeys {
|
||||||
@ -126,7 +127,7 @@ func leaseTimeToLiveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
resp, rerr := mustClientFromCmd(cmd).TimeToLive(context.TODO(), leaseFromArgs(args[0]), opts...)
|
resp, rerr := mustClientFromCmd(cmd).TimeToLive(context.TODO(), leaseFromArgs(args[0]), opts...)
|
||||||
if rerr != nil {
|
if rerr != nil {
|
||||||
ExitWithError(ExitBadConnection, rerr)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, rerr)
|
||||||
}
|
}
|
||||||
display.TimeToLive(*resp, timeToLiveKeys)
|
display.TimeToLive(*resp, timeToLiveKeys)
|
||||||
}
|
}
|
||||||
@ -145,7 +146,7 @@ func NewLeaseListCommand() *cobra.Command {
|
|||||||
func leaseListCommandFunc(cmd *cobra.Command, args []string) {
|
func leaseListCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
resp, rerr := mustClientFromCmd(cmd).Leases(context.TODO())
|
resp, rerr := mustClientFromCmd(cmd).Leases(context.TODO())
|
||||||
if rerr != nil {
|
if rerr != nil {
|
||||||
ExitWithError(ExitBadConnection, rerr)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, rerr)
|
||||||
}
|
}
|
||||||
display.Leases(*resp)
|
display.Leases(*resp)
|
||||||
}
|
}
|
||||||
@ -163,7 +164,7 @@ func NewLeaseKeepAliveCommand() *cobra.Command {
|
|||||||
Run: leaseKeepAliveCommandFunc,
|
Run: leaseKeepAliveCommandFunc,
|
||||||
}
|
}
|
||||||
|
|
||||||
lc.Flags().BoolVar(&leaseKeepAliveOnce, "once", false, "Resets the keep-alive time to its original value and exits immediately")
|
lc.Flags().BoolVar(&leaseKeepAliveOnce, "once", false, "Resets the keep-alive time to its original value and cobrautl.Exits immediately")
|
||||||
|
|
||||||
return lc
|
return lc
|
||||||
}
|
}
|
||||||
@ -171,7 +172,7 @@ func NewLeaseKeepAliveCommand() *cobra.Command {
|
|||||||
// leaseKeepAliveCommandFunc executes the "lease keep-alive" command.
|
// leaseKeepAliveCommandFunc executes the "lease keep-alive" command.
|
||||||
func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
|
func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("lease keep-alive command needs lease ID as argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("lease keep-alive command needs lease ID as argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
id := leaseFromArgs(args[0])
|
id := leaseFromArgs(args[0])
|
||||||
@ -179,7 +180,7 @@ func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
if leaseKeepAliveOnce {
|
if leaseKeepAliveOnce {
|
||||||
respc, kerr := mustClientFromCmd(cmd).KeepAliveOnce(context.TODO(), id)
|
respc, kerr := mustClientFromCmd(cmd).KeepAliveOnce(context.TODO(), id)
|
||||||
if kerr != nil {
|
if kerr != nil {
|
||||||
ExitWithError(ExitBadConnection, kerr)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, kerr)
|
||||||
}
|
}
|
||||||
display.KeepAlive(*respc)
|
display.KeepAlive(*respc)
|
||||||
return
|
return
|
||||||
@ -187,7 +188,7 @@ func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
respc, kerr := mustClientFromCmd(cmd).KeepAlive(context.TODO(), id)
|
respc, kerr := mustClientFromCmd(cmd).KeepAlive(context.TODO(), id)
|
||||||
if kerr != nil {
|
if kerr != nil {
|
||||||
ExitWithError(ExitBadConnection, kerr)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, kerr)
|
||||||
}
|
}
|
||||||
for resp := range respc {
|
for resp := range respc {
|
||||||
display.KeepAlive(*resp)
|
display.KeepAlive(*resp)
|
||||||
@ -201,7 +202,7 @@ func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
func leaseFromArgs(arg string) v3.LeaseID {
|
func leaseFromArgs(arg string) v3.LeaseID {
|
||||||
id, err := strconv.ParseInt(arg, 16, 64)
|
id, err := strconv.ParseInt(arg, 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad lease ID arg (%v), expecting ID in Hex", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad lease ID arg (%v), expecting ID in Hex", err))
|
||||||
}
|
}
|
||||||
return v3.LeaseID(id)
|
return v3.LeaseID(id)
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
"go.etcd.io/etcd/client/v3/concurrency"
|
"go.etcd.io/etcd/client/v3/concurrency"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -44,18 +45,18 @@ func NewLockCommand() *cobra.Command {
|
|||||||
|
|
||||||
func lockCommandFunc(cmd *cobra.Command, args []string) {
|
func lockCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
ExitWithError(ExitBadArgs, errors.New("lock takes a lock name argument and an optional command to execute"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("lock takes a lock name argument and an optional command to execute"))
|
||||||
}
|
}
|
||||||
c := mustClientFromCmd(cmd)
|
c := mustClientFromCmd(cmd)
|
||||||
if err := lockUntilSignal(c, args[0], args[1:]); err != nil {
|
if err := lockUntilSignal(c, args[0], args[1:]); err != nil {
|
||||||
code := getExitCodeFromError(err)
|
code := getExitCodeFromError(err)
|
||||||
ExitWithError(code, err)
|
cobrautl.ExitWithError(code, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getExitCodeFromError(err error) int {
|
func getExitCodeFromError(err error) int {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return ExitSuccess
|
return cobrautl.ExitSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||||
@ -64,7 +65,7 @@ func getExitCodeFromError(err error) int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExitError
|
return cobrautl.ExitError
|
||||||
}
|
}
|
||||||
|
|
||||||
func lockUntilSignal(c *clientv3.Client, lockname string, cmdArgs []string) error {
|
func lockUntilSignal(c *clientv3.Client, lockname string, cmdArgs []string) error {
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bgentry/speakeasy"
|
"github.com/bgentry/speakeasy"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"go.etcd.io/etcd/api/v3/mvccpb"
|
"go.etcd.io/etcd/api/v3/mvccpb"
|
||||||
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
||||||
@ -80,7 +81,7 @@ func authDestCfg() *authCfg {
|
|||||||
cfg.username = mmuser
|
cfg.username = mmuser
|
||||||
cfg.password, err = speakeasy.Ask("Destination Password: ")
|
cfg.password, err = speakeasy.Ask("Destination Password: ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfg.username = splitted[0]
|
cfg.username = splitted[0]
|
||||||
@ -96,7 +97,7 @@ func authDestCfg() *authCfg {
|
|||||||
|
|
||||||
func makeMirrorCommandFunc(cmd *cobra.Command, args []string) {
|
func makeMirrorCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, errors.New("make-mirror takes one destination argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("make-mirror takes one destination argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
dialTimeout := dialTimeoutFromCmd(cmd)
|
dialTimeout := dialTimeoutFromCmd(cmd)
|
||||||
@ -123,7 +124,7 @@ func makeMirrorCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
c := mustClientFromCmd(cmd)
|
c := mustClientFromCmd(cmd)
|
||||||
|
|
||||||
err := makeMirror(context.TODO(), c, dc)
|
err := makeMirror(context.TODO(), c, dc)
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) error {
|
func makeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) error {
|
||||||
@ -142,7 +143,7 @@ func makeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) er
|
|||||||
|
|
||||||
// if destination prefix is specified and remove destination prefix is true return error
|
// if destination prefix is specified and remove destination prefix is true return error
|
||||||
if mmnodestprefix && len(mmdestprefix) > 0 {
|
if mmnodestprefix && len(mmdestprefix) > 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("`--dest-prefix` and `--no-dest-prefix` cannot be set at the same time, choose one"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("`--dest-prefix` and `--no-dest-prefix` cannot be set at the same time, choose one"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// if remove destination prefix is false and destination prefix is empty set the value of destination prefix same as prefix
|
// if remove destination prefix is false and destination prefix is empty set the value of destination prefix same as prefix
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -118,7 +119,7 @@ func NewMemberPromoteCommand() *cobra.Command {
|
|||||||
// memberAddCommandFunc executes the "member add" command.
|
// memberAddCommandFunc executes the "member add" command.
|
||||||
func memberAddCommandFunc(cmd *cobra.Command, args []string) {
|
func memberAddCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
ExitWithError(ExitBadArgs, errors.New("member name not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("member name not provided"))
|
||||||
}
|
}
|
||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
ev := "too many arguments"
|
ev := "too many arguments"
|
||||||
@ -127,12 +128,12 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
ev += fmt.Sprintf(`, did you mean --peer-urls=%s`, s)
|
ev += fmt.Sprintf(`, did you mean --peer-urls=%s`, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExitWithError(ExitBadArgs, errors.New(ev))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New(ev))
|
||||||
}
|
}
|
||||||
newMemberName := args[0]
|
newMemberName := args[0]
|
||||||
|
|
||||||
if len(memberPeerURLs) == 0 {
|
if len(memberPeerURLs) == 0 {
|
||||||
ExitWithError(ExitBadArgs, errors.New("member peer urls not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, errors.New("member peer urls not provided"))
|
||||||
}
|
}
|
||||||
|
|
||||||
urls := strings.Split(memberPeerURLs, ",")
|
urls := strings.Split(memberPeerURLs, ",")
|
||||||
@ -149,7 +150,7 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
newID := resp.Member.ID
|
newID := resp.Member.ID
|
||||||
|
|
||||||
@ -178,19 +179,19 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// memberRemoveCommandFunc executes the "member remove" command.
|
// memberRemoveCommandFunc executes the "member remove" command.
|
||||||
func memberRemoveCommandFunc(cmd *cobra.Command, args []string) {
|
func memberRemoveCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.ParseUint(args[0], 16, 64)
|
id, err := strconv.ParseUint(args[0], 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
resp, err := mustClientFromCmd(cmd).MemberRemove(ctx, id)
|
resp, err := mustClientFromCmd(cmd).MemberRemove(ctx, id)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.MemberRemove(id, *resp)
|
display.MemberRemove(id, *resp)
|
||||||
}
|
}
|
||||||
@ -198,16 +199,16 @@ func memberRemoveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// memberUpdateCommandFunc executes the "member update" command.
|
// memberUpdateCommandFunc executes the "member update" command.
|
||||||
func memberUpdateCommandFunc(cmd *cobra.Command, args []string) {
|
func memberUpdateCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.ParseUint(args[0], 16, 64)
|
id, err := strconv.ParseUint(args[0], 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(memberPeerURLs) == 0 {
|
if len(memberPeerURLs) == 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("member peer urls not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("member peer urls not provided"))
|
||||||
}
|
}
|
||||||
|
|
||||||
urls := strings.Split(memberPeerURLs, ",")
|
urls := strings.Split(memberPeerURLs, ",")
|
||||||
@ -216,7 +217,7 @@ func memberUpdateCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).MemberUpdate(ctx, id, urls)
|
resp, err := mustClientFromCmd(cmd).MemberUpdate(ctx, id, urls)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.MemberUpdate(id, *resp)
|
display.MemberUpdate(id, *resp)
|
||||||
@ -228,7 +229,7 @@ func memberListCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).MemberList(ctx)
|
resp, err := mustClientFromCmd(cmd).MemberList(ctx)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.MemberList(*resp)
|
display.MemberList(*resp)
|
||||||
@ -237,19 +238,19 @@ func memberListCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// memberPromoteCommandFunc executes the "member promote" command.
|
// memberPromoteCommandFunc executes the "member promote" command.
|
||||||
func memberPromoteCommandFunc(cmd *cobra.Command, args []string) {
|
func memberPromoteCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("member ID is not provided"))
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.ParseUint(args[0], 16, 64)
|
id, err := strconv.ParseUint(args[0], 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad member ID arg (%v), expecting ID in Hex", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := commandCtx(cmd)
|
ctx, cancel := commandCtx(cmd)
|
||||||
resp, err := mustClientFromCmd(cmd).MemberPromote(ctx, id)
|
resp, err := mustClientFromCmd(cmd).MemberPromote(ctx, id)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.MemberPromote(id, *resp)
|
display.MemberPromote(id, *resp)
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
"go.etcd.io/etcd/api/v3/mvccpb"
|
"go.etcd.io/etcd/api/v3/mvccpb"
|
||||||
"go.etcd.io/etcd/client/pkg/v3/types"
|
"go.etcd.io/etcd/client/pkg/v3/types"
|
||||||
"go.etcd.io/etcd/client/v2"
|
"go.etcd.io/etcd/client/v2"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
"go.etcd.io/etcd/pkg/v3/pbutil"
|
"go.etcd.io/etcd/pkg/v3/pbutil"
|
||||||
"go.etcd.io/etcd/raft/v3/raftpb"
|
"go.etcd.io/etcd/raft/v3/raftpb"
|
||||||
"go.etcd.io/etcd/server/v3/etcdserver"
|
"go.etcd.io/etcd/server/v3/etcdserver"
|
||||||
@ -96,7 +97,7 @@ func migrateCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
err := <-errc
|
err := <-errc
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("failed to transform keys")
|
fmt.Println("failed to transform keys")
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("finished transforming keys")
|
fmt.Println("finished transforming keys")
|
||||||
@ -139,7 +140,7 @@ func rebuildStoreV2() (st v2store.Store, index uint64, term uint64) {
|
|||||||
ss := snap.New(zap.NewExample(), snapdir)
|
ss := snap.New(zap.NewExample(), snapdir)
|
||||||
snapshot, err := ss.Load()
|
snapshot, err := ss.Load()
|
||||||
if err != nil && err != snap.ErrNoSnapshot {
|
if err != nil && err != snap.ErrNoSnapshot {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var walsnap walpb.Snapshot
|
var walsnap walpb.Snapshot
|
||||||
@ -151,20 +152,20 @@ func rebuildStoreV2() (st v2store.Store, index uint64, term uint64) {
|
|||||||
|
|
||||||
w, err := wal.OpenForRead(zap.NewExample(), waldir, walsnap)
|
w, err := wal.OpenForRead(zap.NewExample(), waldir, walsnap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
defer w.Close()
|
defer w.Close()
|
||||||
|
|
||||||
_, _, ents, err := w.ReadAll()
|
_, _, ents, err := w.ReadAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
st = v2store.New()
|
st = v2store.New()
|
||||||
if snapshot != nil {
|
if snapshot != nil {
|
||||||
err := st.Recovery(snapshot.Data)
|
err := st.Recovery(snapshot.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +249,7 @@ func writeStore(w io.Writer, st v2store.Store) uint64 {
|
|||||||
fmt.Println("no v2 keys to migrate")
|
fmt.Println("no v2 keys to migrate")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return writeKeys(w, all.Node)
|
return writeKeys(w, all.Node)
|
||||||
}
|
}
|
||||||
@ -268,7 +269,7 @@ func writeKeys(w io.Writer, n *v2store.NodeExtern) uint64 {
|
|||||||
if !migrateExcludeTTLKey || n.TTL == 0 {
|
if !migrateExcludeTTLKey || n.TTL == 0 {
|
||||||
b, err := json.Marshal(n)
|
b, err := json.Marshal(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
fmt.Fprint(w, string(b))
|
fmt.Fprint(w, string(b))
|
||||||
}
|
}
|
||||||
@ -318,16 +319,16 @@ func startTransformer() (io.WriteCloser, io.ReadCloser, chan error) {
|
|||||||
|
|
||||||
writer, err := cmd.StdinPipe()
|
writer, err := cmd.StdinPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
reader, rerr := cmd.StdoutPipe()
|
reader, rerr := cmd.StdoutPipe()
|
||||||
if rerr != nil {
|
if rerr != nil {
|
||||||
ExitWithError(ExitError, rerr)
|
cobrautl.ExitWithError(cobrautl.ExitError, rerr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
errc := make(chan error, 1)
|
errc := make(chan error, 1)
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewMoveLeaderCommand returns the cobra command for "move-leader".
|
// NewMoveLeaderCommand returns the cobra command for "move-leader".
|
||||||
@ -35,11 +36,11 @@ func NewMoveLeaderCommand() *cobra.Command {
|
|||||||
// transferLeadershipCommandFunc executes the "compaction" command.
|
// transferLeadershipCommandFunc executes the "compaction" command.
|
||||||
func transferLeadershipCommandFunc(cmd *cobra.Command, args []string) {
|
func transferLeadershipCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("move-leader command needs 1 argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("move-leader command needs 1 argument"))
|
||||||
}
|
}
|
||||||
target, err := strconv.ParseUint(args[0], 16, 64)
|
target, err := strconv.ParseUint(args[0], 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c := mustClientFromCmd(cmd)
|
c := mustClientFromCmd(cmd)
|
||||||
@ -57,7 +58,7 @@ func transferLeadershipCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
cli := cfg.mustClient()
|
cli := cfg.mustClient()
|
||||||
resp, serr := cli.Status(ctx, ep)
|
resp, serr := cli.Status(ctx, ep)
|
||||||
if serr != nil {
|
if serr != nil {
|
||||||
ExitWithError(ExitError, serr)
|
cobrautl.ExitWithError(cobrautl.ExitError, serr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.Header.GetMemberId() == resp.Leader {
|
if resp.Header.GetMemberId() == resp.Leader {
|
||||||
@ -68,14 +69,14 @@ func transferLeadershipCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
cli.Close()
|
cli.Close()
|
||||||
}
|
}
|
||||||
if leaderCli == nil {
|
if leaderCli == nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("no leader endpoint given at %v", eps))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("no leader endpoint given at %v", eps))
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp *clientv3.MoveLeaderResponse
|
var resp *clientv3.MoveLeaderResponse
|
||||||
resp, err = leaderCli.MoveLeader(ctx, target)
|
resp, err = leaderCli.MoveLeader(ctx, target)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.MoveLeader(leaderID, target, *resp)
|
display.MoveLeader(leaderID, target, *resp)
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
"go.etcd.io/etcd/etcdctl/v3/snapshot"
|
"go.etcd.io/etcd/etcdctl/v3/snapshot"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
)
|
)
|
||||||
@ -151,7 +152,7 @@ type printerUnsupported struct{ printerRPC }
|
|||||||
|
|
||||||
func newPrinterUnsupported(n string) printer {
|
func newPrinterUnsupported(n string) printer {
|
||||||
f := func(interface{}) {
|
f := func(interface{}) {
|
||||||
ExitWithError(ExitBadFeature, errors.New(n+" not supported as output format"))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, errors.New(n+" not supported as output format"))
|
||||||
}
|
}
|
||||||
return &printerUnsupported{printerRPC{nil, f}}
|
return &printerUnsupported{printerRPC{nil, f}}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
||||||
mvccpb "go.etcd.io/etcd/api/v3/mvccpb"
|
mvccpb "go.etcd.io/etcd/api/v3/mvccpb"
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pbPrinter struct{ printer }
|
type pbPrinter struct{ printer }
|
||||||
@ -53,7 +54,7 @@ func (p *pbPrinter) Watch(r v3.WatchResponse) {
|
|||||||
func printPB(v interface{}) {
|
func printPB(v interface{}) {
|
||||||
m, ok := v.(pbMarshal)
|
m, ok := v.(pbMarshal)
|
||||||
if !ok {
|
if !ok {
|
||||||
ExitWithError(ExitBadFeature, fmt.Errorf("marshal unsupported for type %T (%v)", v, v))
|
cobrautl.ExitWithError(cobrautl.ExitBadFeature, fmt.Errorf("marshal unsupported for type %T (%v)", v, v))
|
||||||
}
|
}
|
||||||
b, err := m.Marshal()
|
b, err := m.Marshal()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -71,19 +72,19 @@ func putCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
resp, err := mustClientFromCmd(cmd).Put(ctx, key, value, opts...)
|
resp, err := mustClientFromCmd(cmd).Put(ctx, key, value, opts...)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.Put(*resp)
|
display.Put(*resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPutOp(args []string) (string, string, []clientv3.OpOption) {
|
func getPutOp(args []string) (string, string, []clientv3.OpOption) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("put command needs 1 argument and input from stdin or 2 arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("put command needs 1 argument and input from stdin or 2 arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
key := args[0]
|
key := args[0]
|
||||||
if putIgnoreVal && len(args) > 1 {
|
if putIgnoreVal && len(args) > 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("put command needs only 1 argument when 'ignore-value' is set"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("put command needs only 1 argument when 'ignore-value' is set"))
|
||||||
}
|
}
|
||||||
|
|
||||||
var value string
|
var value string
|
||||||
@ -91,13 +92,13 @@ func getPutOp(args []string) (string, string, []clientv3.OpOption) {
|
|||||||
if !putIgnoreVal {
|
if !putIgnoreVal {
|
||||||
value, err = argOrStdin(args, os.Stdin, 1)
|
value, err = argOrStdin(args, os.Stdin, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("put command needs 1 argument and input from stdin or 2 arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("put command needs 1 argument and input from stdin or 2 arguments"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.ParseInt(leaseStr, 16, 64)
|
id, err := strconv.ParseInt(leaseStr, 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("bad lease ID (%v), expecting ID in Hex", err))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("bad lease ID (%v), expecting ID in Hex", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := []clientv3.OpOption{}
|
opts := []clientv3.OpOption{}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -105,12 +106,12 @@ func newRoleRevokePermissionCommand() *cobra.Command {
|
|||||||
// roleAddCommandFunc executes the "role add" command.
|
// roleAddCommandFunc executes the "role add" command.
|
||||||
func roleAddCommandFunc(cmd *cobra.Command, args []string) {
|
func roleAddCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role add command requires role name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role add command requires role name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleAdd(context.TODO(), args[0])
|
resp, err := mustClientFromCmd(cmd).Auth.RoleAdd(context.TODO(), args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.RoleAdd(args[0], *resp)
|
display.RoleAdd(args[0], *resp)
|
||||||
@ -119,12 +120,12 @@ func roleAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// roleDeleteCommandFunc executes the "role delete" command.
|
// roleDeleteCommandFunc executes the "role delete" command.
|
||||||
func roleDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
func roleDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role delete command requires role name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role delete command requires role name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleDelete(context.TODO(), args[0])
|
resp, err := mustClientFromCmd(cmd).Auth.RoleDelete(context.TODO(), args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.RoleDelete(args[0], *resp)
|
display.RoleDelete(args[0], *resp)
|
||||||
@ -133,13 +134,13 @@ func roleDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// roleGetCommandFunc executes the "role get" command.
|
// roleGetCommandFunc executes the "role get" command.
|
||||||
func roleGetCommandFunc(cmd *cobra.Command, args []string) {
|
func roleGetCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role get command requires role name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role get command requires role name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleGet(context.TODO(), name)
|
resp, err := mustClientFromCmd(cmd).Auth.RoleGet(context.TODO(), name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.RoleGet(name, *resp)
|
display.RoleGet(name, *resp)
|
||||||
@ -148,12 +149,12 @@ func roleGetCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// roleListCommandFunc executes the "role list" command.
|
// roleListCommandFunc executes the "role list" command.
|
||||||
func roleListCommandFunc(cmd *cobra.Command, args []string) {
|
func roleListCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role list command requires no arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role list command requires no arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleList(context.TODO())
|
resp, err := mustClientFromCmd(cmd).Auth.RoleList(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.RoleList(*resp)
|
display.RoleList(*resp)
|
||||||
@ -162,18 +163,18 @@ func roleListCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// roleGrantPermissionCommandFunc executes the "role grant-permission" command.
|
// roleGrantPermissionCommandFunc executes the "role grant-permission" command.
|
||||||
func roleGrantPermissionCommandFunc(cmd *cobra.Command, args []string) {
|
func roleGrantPermissionCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) < 3 {
|
if len(args) < 3 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role grant command requires role name, permission type, and key [endkey] as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role grant command requires role name, permission type, and key [endkey] as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
perm, err := clientv3.StrToPermissionType(args[1])
|
perm, err := clientv3.StrToPermissionType(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
key, rangeEnd := permRange(args[2:])
|
key, rangeEnd := permRange(args[2:])
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleGrantPermission(context.TODO(), args[0], key, rangeEnd, perm)
|
resp, err := mustClientFromCmd(cmd).Auth.RoleGrantPermission(context.TODO(), args[0], key, rangeEnd, perm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.RoleGrantPermission(args[0], *resp)
|
display.RoleGrantPermission(args[0], *resp)
|
||||||
@ -182,13 +183,13 @@ func roleGrantPermissionCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// roleRevokePermissionCommandFunc executes the "role revoke-permission" command.
|
// roleRevokePermissionCommandFunc executes the "role revoke-permission" command.
|
||||||
func roleRevokePermissionCommandFunc(cmd *cobra.Command, args []string) {
|
func roleRevokePermissionCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("role revoke-permission command requires role name and key [endkey] as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("role revoke-permission command requires role name and key [endkey] as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
key, rangeEnd := permRange(args[1:])
|
key, rangeEnd := permRange(args[1:])
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.RoleRevokePermission(context.TODO(), args[0], key, rangeEnd)
|
resp, err := mustClientFromCmd(cmd).Auth.RoleRevokePermission(context.TODO(), args[0], key, rangeEnd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.RoleRevokePermission(args[0], args[1], rangeEnd, *resp)
|
display.RoleRevokePermission(args[0], args[1], rangeEnd, *resp)
|
||||||
}
|
}
|
||||||
@ -198,7 +199,7 @@ func permRange(args []string) (string, string) {
|
|||||||
var rangeEnd string
|
var rangeEnd string
|
||||||
if len(key) == 0 {
|
if len(key) == 0 {
|
||||||
if rolePermPrefix && rolePermFromKey {
|
if rolePermPrefix && rolePermFromKey {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("--from-key and --prefix flags are mutually exclusive"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("--from-key and --prefix flags are mutually exclusive"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range permission is expressed as adt.BytesAffineInterval,
|
// Range permission is expressed as adt.BytesAffineInterval,
|
||||||
@ -214,7 +215,7 @@ func permRange(args []string) (string, string) {
|
|||||||
var err error
|
var err error
|
||||||
rangeEnd, err = rangeEndFromPermFlags(args[0:])
|
rangeEnd, err = rangeEndFromPermFlags(args[0:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return key, rangeEnd
|
return key, rangeEnd
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.etcd.io/etcd/etcdctl/v3/snapshot"
|
"go.etcd.io/etcd/etcdctl/v3/snapshot"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@ -92,12 +93,12 @@ func NewSnapshotRestoreCommand() *cobra.Command {
|
|||||||
func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) {
|
func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
err := fmt.Errorf("snapshot save expects one argument")
|
err := fmt.Errorf("snapshot save expects one argument")
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
lg, err := zap.NewProduction()
|
lg, err := zap.NewProduction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
sp := snapshot.NewV3(lg)
|
sp := snapshot.NewV3(lg)
|
||||||
cfg := mustClientCfgFromCmd(cmd)
|
cfg := mustClientCfgFromCmd(cmd)
|
||||||
@ -111,7 +112,7 @@ func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
path := args[0]
|
path := args[0]
|
||||||
if err := sp.Save(ctx, *cfg, path); err != nil {
|
if err := sp.Save(ctx, *cfg, path); err != nil {
|
||||||
ExitWithError(ExitInterrupted, err)
|
cobrautl.ExitWithError(cobrautl.ExitInterrupted, err)
|
||||||
}
|
}
|
||||||
fmt.Printf("Snapshot saved at %s\n", path)
|
fmt.Printf("Snapshot saved at %s\n", path)
|
||||||
}
|
}
|
||||||
@ -119,18 +120,18 @@ func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
func snapshotStatusCommandFunc(cmd *cobra.Command, args []string) {
|
func snapshotStatusCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
err := fmt.Errorf("snapshot status requires exactly one argument")
|
err := fmt.Errorf("snapshot status requires exactly one argument")
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
initDisplayFromCmd(cmd)
|
initDisplayFromCmd(cmd)
|
||||||
|
|
||||||
lg, err := zap.NewProduction()
|
lg, err := zap.NewProduction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
sp := snapshot.NewV3(lg)
|
sp := snapshot.NewV3(lg)
|
||||||
ds, err := sp.Status(args[0])
|
ds, err := sp.Status(args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.DBStatus(ds)
|
display.DBStatus(ds)
|
||||||
}
|
}
|
||||||
@ -138,7 +139,7 @@ func snapshotStatusCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
func snapshotRestoreCommandFunc(cmd *cobra.Command, args []string) {
|
func snapshotRestoreCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
err := fmt.Errorf("snapshot restore requires exactly one argument")
|
err := fmt.Errorf("snapshot restore requires exactly one argument")
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dataDir := restoreDataDir
|
dataDir := restoreDataDir
|
||||||
@ -153,7 +154,7 @@ func snapshotRestoreCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
lg, err := zap.NewProduction()
|
lg, err := zap.NewProduction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
sp := snapshot.NewV3(lg)
|
sp := snapshot.NewV3(lg)
|
||||||
|
|
||||||
@ -167,7 +168,7 @@ func snapshotRestoreCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
InitialClusterToken: restoreClusterToken,
|
InitialClusterToken: restoreClusterToken,
|
||||||
SkipHashCheck: skipHashCheck,
|
SkipHashCheck: skipHashCheck,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
|
|
||||||
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -44,7 +45,7 @@ func NewTxnCommand() *cobra.Command {
|
|||||||
// txnCommandFunc executes the "txn" command.
|
// txnCommandFunc executes the "txn" command.
|
||||||
func txnCommandFunc(cmd *cobra.Command, args []string) {
|
func txnCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("txn command does not accept argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("txn command does not accept argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
@ -59,7 +60,7 @@ func txnCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
resp, err := txn.Commit()
|
resp, err := txn.Commit()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.Txn(*resp)
|
display.Txn(*resp)
|
||||||
@ -75,7 +76,7 @@ func readCompares(r *bufio.Reader) (cmps []clientv3.Cmp) {
|
|||||||
for {
|
for {
|
||||||
line, err := r.ReadString('\n')
|
line, err := r.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitInvalidInput, err)
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove space from the line
|
// remove space from the line
|
||||||
@ -86,7 +87,7 @@ func readCompares(r *bufio.Reader) (cmps []clientv3.Cmp) {
|
|||||||
|
|
||||||
cmp, err := parseCompare(line)
|
cmp, err := parseCompare(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitInvalidInput, err)
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
|
||||||
}
|
}
|
||||||
cmps = append(cmps, *cmp)
|
cmps = append(cmps, *cmp)
|
||||||
}
|
}
|
||||||
@ -98,7 +99,7 @@ func readOps(r *bufio.Reader) (ops []clientv3.Op) {
|
|||||||
for {
|
for {
|
||||||
line, err := r.ReadString('\n')
|
line, err := r.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitInvalidInput, err)
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove space from the line
|
// remove space from the line
|
||||||
@ -109,7 +110,7 @@ func readOps(r *bufio.Reader) (ops []clientv3.Op) {
|
|||||||
|
|
||||||
op, err := parseRequestUnion(line)
|
op, err := parseRequestUnion(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitInvalidInput, err)
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
|
||||||
}
|
}
|
||||||
ops = append(ops, *op)
|
ops = append(ops, *op)
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/bgentry/speakeasy"
|
"github.com/bgentry/speakeasy"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -125,7 +126,7 @@ func newUserRevokeRoleCommand() *cobra.Command {
|
|||||||
// userAddCommandFunc executes the "user add" command.
|
// userAddCommandFunc executes the "user add" command.
|
||||||
func userAddCommandFunc(cmd *cobra.Command, args []string) {
|
func userAddCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user add command requires user name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user add command requires user name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
var password string
|
var password string
|
||||||
@ -152,7 +153,7 @@ func userAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
user = splitted[0]
|
user = splitted[0]
|
||||||
password = splitted[1]
|
password = splitted[1]
|
||||||
if len(user) == 0 {
|
if len(user) == 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("empty user name is not allowed"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("empty user name is not allowed"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +164,7 @@ func userAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserAddWithOptions(context.TODO(), user, password, options)
|
resp, err := mustClientFromCmd(cmd).Auth.UserAddWithOptions(context.TODO(), user, password, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.UserAdd(user, *resp)
|
display.UserAdd(user, *resp)
|
||||||
@ -172,12 +173,12 @@ func userAddCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userDeleteCommandFunc executes the "user delete" command.
|
// userDeleteCommandFunc executes the "user delete" command.
|
||||||
func userDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
func userDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user delete command requires user name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user delete command requires user name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserDelete(context.TODO(), args[0])
|
resp, err := mustClientFromCmd(cmd).Auth.UserDelete(context.TODO(), args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.UserDelete(args[0], *resp)
|
display.UserDelete(args[0], *resp)
|
||||||
}
|
}
|
||||||
@ -185,14 +186,14 @@ func userDeleteCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userGetCommandFunc executes the "user get" command.
|
// userGetCommandFunc executes the "user get" command.
|
||||||
func userGetCommandFunc(cmd *cobra.Command, args []string) {
|
func userGetCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user get command requires user name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user get command requires user name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
client := mustClientFromCmd(cmd)
|
client := mustClientFromCmd(cmd)
|
||||||
resp, err := client.Auth.UserGet(context.TODO(), name)
|
resp, err := client.Auth.UserGet(context.TODO(), name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if userShowDetail {
|
if userShowDetail {
|
||||||
@ -201,7 +202,7 @@ func userGetCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
roleResp, err := client.Auth.RoleGet(context.TODO(), role)
|
roleResp, err := client.Auth.RoleGet(context.TODO(), role)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
display.RoleGet(role, *roleResp)
|
display.RoleGet(role, *roleResp)
|
||||||
}
|
}
|
||||||
@ -213,12 +214,12 @@ func userGetCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userListCommandFunc executes the "user list" command.
|
// userListCommandFunc executes the "user list" command.
|
||||||
func userListCommandFunc(cmd *cobra.Command, args []string) {
|
func userListCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user list command requires no arguments"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user list command requires no arguments"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserList(context.TODO())
|
resp, err := mustClientFromCmd(cmd).Auth.UserList(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.UserList(*resp)
|
display.UserList(*resp)
|
||||||
@ -227,7 +228,7 @@ func userListCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userChangePasswordCommandFunc executes the "user passwd" command.
|
// userChangePasswordCommandFunc executes the "user passwd" command.
|
||||||
func userChangePasswordCommandFunc(cmd *cobra.Command, args []string) {
|
func userChangePasswordCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user passwd command requires user name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user passwd command requires user name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
var password string
|
var password string
|
||||||
@ -240,7 +241,7 @@ func userChangePasswordCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserChangePassword(context.TODO(), args[0], password)
|
resp, err := mustClientFromCmd(cmd).Auth.UserChangePassword(context.TODO(), args[0], password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.UserChangePassword(*resp)
|
display.UserChangePassword(*resp)
|
||||||
@ -249,12 +250,12 @@ func userChangePasswordCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userGrantRoleCommandFunc executes the "user grant-role" command.
|
// userGrantRoleCommandFunc executes the "user grant-role" command.
|
||||||
func userGrantRoleCommandFunc(cmd *cobra.Command, args []string) {
|
func userGrantRoleCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user grant command requires user name and role name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user grant command requires user name and role name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserGrantRole(context.TODO(), args[0], args[1])
|
resp, err := mustClientFromCmd(cmd).Auth.UserGrantRole(context.TODO(), args[0], args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.UserGrantRole(args[0], args[1], *resp)
|
display.UserGrantRole(args[0], args[1], *resp)
|
||||||
@ -263,12 +264,12 @@ func userGrantRoleCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
// userRevokeRoleCommandFunc executes the "user revoke-role" command.
|
// userRevokeRoleCommandFunc executes the "user revoke-role" command.
|
||||||
func userRevokeRoleCommandFunc(cmd *cobra.Command, args []string) {
|
func userRevokeRoleCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("user revoke-role requires user name and role name as its argument"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("user revoke-role requires user name and role name as its argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := mustClientFromCmd(cmd).Auth.UserRevokeRole(context.TODO(), args[0], args[1])
|
resp, err := mustClientFromCmd(cmd).Auth.UserRevokeRole(context.TODO(), args[0], args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
display.UserRevokeRole(args[0], args[1], *resp)
|
display.UserRevokeRole(args[0], args[1], *resp)
|
||||||
@ -278,21 +279,21 @@ func readPasswordInteractive(name string) string {
|
|||||||
prompt1 := fmt.Sprintf("Password of %s: ", name)
|
prompt1 := fmt.Sprintf("Password of %s: ", name)
|
||||||
password1, err1 := speakeasy.Ask(prompt1)
|
password1, err1 := speakeasy.Ask(prompt1)
|
||||||
if err1 != nil {
|
if err1 != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("failed to ask password: %s", err1))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("failed to ask password: %s", err1))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(password1) == 0 {
|
if len(password1) == 0 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("empty password"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("empty password"))
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt2 := fmt.Sprintf("Type password of %s again for confirmation: ", name)
|
prompt2 := fmt.Sprintf("Type password of %s again for confirmation: ", name)
|
||||||
password2, err2 := speakeasy.Ask(prompt2)
|
password2, err2 := speakeasy.Ask(prompt2)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("failed to ask password: %s", err2))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("failed to ask password: %s", err2))
|
||||||
}
|
}
|
||||||
|
|
||||||
if password1 != password2 {
|
if password1 != password2 {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("given passwords are different"))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("given passwords are different"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return password1
|
return password1
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
|
|
||||||
pb "go.etcd.io/etcd/api/v3/mvccpb"
|
pb "go.etcd.io/etcd/api/v3/mvccpb"
|
||||||
v3 "go.etcd.io/etcd/client/v3"
|
v3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -68,7 +69,7 @@ func argify(s string) []string {
|
|||||||
} else if args[i][0] == '"' {
|
} else if args[i][0] == '"' {
|
||||||
// "double quoted string"
|
// "double quoted string"
|
||||||
if _, err := fmt.Sscanf(args[i], "%q", &args[i]); err != nil {
|
if _, err := fmt.Sscanf(args[i], "%q", &args[i]); err != nil {
|
||||||
ExitWithError(ExitInvalidInput, err)
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +79,7 @@ func argify(s string) []string {
|
|||||||
func commandCtx(cmd *cobra.Command) (context.Context, context.CancelFunc) {
|
func commandCtx(cmd *cobra.Command) (context.Context, context.CancelFunc) {
|
||||||
timeOut, err := cmd.Flags().GetDuration("command-timeout")
|
timeOut, err := cmd.Flags().GetDuration("command-timeout")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
return context.WithTimeout(context.Background(), timeOut)
|
return context.WithTimeout(context.Background(), timeOut)
|
||||||
}
|
}
|
||||||
@ -149,7 +150,7 @@ func compact(c *v3.Client, rev int64) {
|
|||||||
_, err := c.Compact(ctx, rev, v3.WithCompactPhysical())
|
_, err := c.Compact(ctx, rev, v3.WithCompactPhysical())
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
fmt.Printf("Compacted with revision %d\n", rev)
|
fmt.Printf("Compacted with revision %d\n", rev)
|
||||||
}
|
}
|
||||||
@ -161,7 +162,7 @@ func defrag(c *v3.Client, ep string) {
|
|||||||
_, err := c.Defragment(ctx, ep)
|
_, err := c.Defragment(ctx, ep)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
fmt.Printf("Defragmented %q\n", ep)
|
fmt.Printf("Defragmented %q\n", ep)
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -64,7 +65,7 @@ func NewWatchCommand() *cobra.Command {
|
|||||||
func watchCommandFunc(cmd *cobra.Command, args []string) {
|
func watchCommandFunc(cmd *cobra.Command, args []string) {
|
||||||
envKey, envRange := os.Getenv("ETCDCTL_WATCH_KEY"), os.Getenv("ETCDCTL_WATCH_RANGE_END")
|
envKey, envRange := os.Getenv("ETCDCTL_WATCH_KEY"), os.Getenv("ETCDCTL_WATCH_RANGE_END")
|
||||||
if envKey == "" && envRange != "" {
|
if envKey == "" && envRange != "" {
|
||||||
ExitWithError(ExitBadArgs, fmt.Errorf("ETCDCTL_WATCH_KEY is empty but got ETCDCTL_WATCH_RANGE_END=%q", envRange))
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("ETCDCTL_WATCH_KEY is empty but got ETCDCTL_WATCH_RANGE_END=%q", envRange))
|
||||||
}
|
}
|
||||||
|
|
||||||
if watchInteractive {
|
if watchInteractive {
|
||||||
@ -74,20 +75,20 @@ func watchCommandFunc(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
watchArgs, execArgs, err := parseWatchArgs(os.Args, args, envKey, envRange, false)
|
watchArgs, execArgs, err := parseWatchArgs(os.Args, args, envKey, envRange, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c := mustClientFromCmd(cmd)
|
c := mustClientFromCmd(cmd)
|
||||||
wc, err := getWatchChan(c, watchArgs)
|
wc, err := getWatchChan(c, watchArgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitBadArgs, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printWatchCh(c, wc, execArgs)
|
printWatchCh(c, wc, execArgs)
|
||||||
if err = c.Close(); err != nil {
|
if err = c.Close(); err != nil {
|
||||||
ExitWithError(ExitBadConnection, err)
|
cobrautl.ExitWithError(cobrautl.ExitBadConnection, err)
|
||||||
}
|
}
|
||||||
ExitWithError(ExitInterrupted, fmt.Errorf("watch is canceled by the server"))
|
cobrautl.ExitWithError(cobrautl.ExitInterrupted, fmt.Errorf("watch is canceled by the server"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange string) {
|
func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange string) {
|
||||||
@ -98,7 +99,7 @@ func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange
|
|||||||
for {
|
for {
|
||||||
l, err := reader.ReadString('\n')
|
l, err := reader.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitInvalidInput, fmt.Errorf("error reading watch request line: %v", err))
|
cobrautl.ExitWithError(cobrautl.ExitInvalidInput, fmt.Errorf("error reading watch request line: %v", err))
|
||||||
}
|
}
|
||||||
l = strings.TrimSuffix(l, "\n")
|
l = strings.TrimSuffix(l, "\n")
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange
|
|||||||
}
|
}
|
||||||
watchArgs, execArgs, perr := parseWatchArgs(osArgs, args, envKey, envRange, true)
|
watchArgs, execArgs, perr := parseWatchArgs(osArgs, args, envKey, envRange, true)
|
||||||
if perr != nil {
|
if perr != nil {
|
||||||
ExitWithError(ExitBadArgs, perr)
|
cobrautl.ExitWithError(cobrautl.ExitBadArgs, perr)
|
||||||
}
|
}
|
||||||
|
|
||||||
ch, err := getWatchChan(c, watchArgs)
|
ch, err := getWatchChan(c, watchArgs)
|
||||||
@ -127,7 +128,7 @@ func watchInteractiveFunc(cmd *cobra.Command, osArgs []string, envKey, envRange
|
|||||||
case "progress":
|
case "progress":
|
||||||
err := c.RequestProgress(clientv3.WithRequireLeader(context.Background()))
|
err := c.RequestProgress(clientv3.WithRequireLeader(context.Background()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ExitWithError(ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(os.Stderr, "Invalid command %s (only support watch)\n", l)
|
fmt.Fprintf(os.Stderr, "Invalid command %s (only support watch)\n", l)
|
||||||
|
@ -18,7 +18,9 @@ package ctlv3
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"go.etcd.io/etcd/api/v3/version"
|
||||||
"go.etcd.io/etcd/etcdctl/v3/ctlv3/command"
|
"go.etcd.io/etcd/etcdctl/v3/ctlv3/command"
|
||||||
|
"go.etcd.io/etcd/pkg/v3/cobrautl"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -95,6 +97,10 @@ func init() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func usageFunc(c *cobra.Command) error {
|
||||||
|
return cobrautl.UsageFunc(c, version.Version, version.APIVersion)
|
||||||
|
}
|
||||||
|
|
||||||
func Start() error {
|
func Start() error {
|
||||||
rootCmd.SetUsageFunc(usageFunc)
|
rootCmd.SetUsageFunc(usageFunc)
|
||||||
// Make help just show the usage
|
// Make help just show the usage
|
||||||
@ -104,7 +110,7 @@ func Start() error {
|
|||||||
|
|
||||||
func MustStart() {
|
func MustStart() {
|
||||||
if err := Start(); err != nil {
|
if err := Start(); err != nil {
|
||||||
command.ExitWithError(command.ExitError, err)
|
cobrautl.ExitWithError(cobrautl.ExitError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ require (
|
|||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/gogo/protobuf v1.3.2
|
github.com/gogo/protobuf v1.3.2
|
||||||
github.com/olekukonko/tablewriter v0.0.4
|
github.com/olekukonko/tablewriter v0.0.4
|
||||||
github.com/spf13/cobra v1.1.1
|
github.com/spf13/cobra v1.1.3
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/urfave/cli v1.22.4
|
github.com/urfave/cli v1.22.4
|
||||||
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
||||||
|
@ -265,8 +265,8 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE
|
|||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
@ -508,8 +508,9 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
2
go.mod
2
go.mod
@ -18,7 +18,7 @@ require (
|
|||||||
github.com/bgentry/speakeasy v0.1.0
|
github.com/bgentry/speakeasy v0.1.0
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||||
github.com/spf13/cobra v1.1.1
|
github.com/spf13/cobra v1.1.3
|
||||||
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
||||||
go.etcd.io/etcd/api/v3 v3.5.0-alpha.0
|
go.etcd.io/etcd/api/v3 v3.5.0-alpha.0
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0-alpha.0
|
go.etcd.io/etcd/client/pkg/v3 v3.5.0-alpha.0
|
||||||
|
8
go.sum
8
go.sum
@ -273,8 +273,8 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE
|
|||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
@ -525,8 +525,8 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
@ -12,13 +12,11 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package command
|
package cobrautl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -31,12 +29,12 @@ const (
|
|||||||
ExitInterrupted
|
ExitInterrupted
|
||||||
ExitIO
|
ExitIO
|
||||||
ExitBadArgs = 128
|
ExitBadArgs = 128
|
||||||
|
|
||||||
|
ExitServerError = 4
|
||||||
|
ExitClusterNotHealthy = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExitWithError(code int, err error) {
|
func ExitWithError(code int, err error) {
|
||||||
fmt.Fprintln(os.Stderr, "Error:", err)
|
fmt.Fprintln(os.Stderr, "Error:", err)
|
||||||
if cerr, ok := err.(*client.ClusterError); ok {
|
|
||||||
fmt.Fprintln(os.Stderr, cerr.Detail())
|
|
||||||
}
|
|
||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
// copied from https://github.com/rkt/rkt/blob/master/rkt/help.go
|
// copied from https://github.com/rkt/rkt/blob/master/rkt/help.go
|
||||||
|
|
||||||
package ctlv3
|
package cobrautl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@ -25,8 +25,6 @@ import (
|
|||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"go.etcd.io/etcd/api/v3/version"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
@ -146,7 +144,7 @@ func getSubCommands(cmd *cobra.Command) []*cobra.Command {
|
|||||||
return subCommands
|
return subCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
func usageFunc(cmd *cobra.Command) error {
|
func UsageFunc(cmd *cobra.Command, version, APIVersion string) error {
|
||||||
subCommands := getSubCommands(cmd)
|
subCommands := getSubCommands(cmd)
|
||||||
tabOut := getTabOutWithWriter(os.Stdout)
|
tabOut := getTabOutWithWriter(os.Stdout)
|
||||||
commandUsageTemplate.Execute(tabOut, struct {
|
commandUsageTemplate.Execute(tabOut, struct {
|
||||||
@ -161,8 +159,8 @@ func usageFunc(cmd *cobra.Command) error {
|
|||||||
etcdFlagUsages(cmd.LocalFlags()),
|
etcdFlagUsages(cmd.LocalFlags()),
|
||||||
etcdFlagUsages(cmd.InheritedFlags()),
|
etcdFlagUsages(cmd.InheritedFlags()),
|
||||||
subCommands,
|
subCommands,
|
||||||
version.Version,
|
version,
|
||||||
version.APIVersion,
|
APIVersion,
|
||||||
})
|
})
|
||||||
tabOut.Flush()
|
tabOut.Flush()
|
||||||
return nil
|
return nil
|
@ -6,6 +6,7 @@ require (
|
|||||||
github.com/creack/pty v1.1.11
|
github.com/creack/pty v1.1.11
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/golang/protobuf v1.5.1 // indirect
|
github.com/golang/protobuf v1.5.1 // indirect
|
||||||
|
github.com/spf13/cobra v1.1.3
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0-alpha.0
|
go.etcd.io/etcd/client/pkg/v3 v3.5.0-alpha.0
|
||||||
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19
|
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19
|
||||||
|
249
pkg/go.sum
249
pkg/go.sum
@ -1,24 +1,70 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
|
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||||
|
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||||
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
|
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||||
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
|
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||||
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||||
|
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||||
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||||
|
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||||
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
|
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||||
|
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||||
|
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||||
|
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
|
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
|
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
github.com/coreos/go-systemd/v22 v22.3.1/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
github.com/coreos/go-systemd/v22 v22.3.1/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||||
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
||||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||||
|
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
|
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
@ -30,6 +76,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
|||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc=
|
github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc=
|
||||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||||
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
@ -37,58 +85,240 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
|
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||||
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||||
|
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||||
|
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||||
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
|
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||||
|
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||||
|
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
|
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||||
|
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||||
|
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||||
|
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||||
|
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||||
|
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||||
|
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||||
|
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||||
|
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||||
|
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||||
|
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||||
|
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||||
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
|
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||||
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||||
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
|
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||||
|
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
|
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||||
|
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||||
|
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
|
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||||
|
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||||
|
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||||
|
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||||
|
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||||
|
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
|
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||||
|
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||||
|
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
|
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
|
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||||
|
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||||
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
|
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
|
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||||
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||||
|
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||||
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
|
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||||
|
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||||
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
|
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||||
|
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||||
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||||
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
|
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||||
|
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||||
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
|
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||||
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
|
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||||
|
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||||
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19 h1:040c3dLNhgFQkoojH2AMpHCy4SrvhmxdU72d9GLGGE0=
|
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19 h1:040c3dLNhgFQkoojH2AMpHCy4SrvhmxdU72d9GLGGE0=
|
||||||
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19/go.mod h1:aMfIlz3TDBfB0BwTCKFU1XbEmj9zevr5S5LcBr85MXw=
|
go.uber.org/zap v1.16.1-0.20210329175301-c23abee72d19/go.mod h1:aMfIlz3TDBfB0BwTCKFU1XbEmj9zevr5S5LcBr85MXw=
|
||||||
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
|
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||||
|
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||||
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
|
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
|
||||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||||
|
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
|
||||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
@ -106,8 +336,21 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
|||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
|
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||||
|
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||||
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
@ -22,7 +22,7 @@ require (
|
|||||||
github.com/prometheus/procfs v0.2.0 // indirect
|
github.com/prometheus/procfs v0.2.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.7.0 // indirect
|
github.com/sirupsen/logrus v1.7.0 // indirect
|
||||||
github.com/soheilhy/cmux v0.1.5
|
github.com/soheilhy/cmux v0.1.5
|
||||||
github.com/spf13/cobra v1.1.1
|
github.com/spf13/cobra v1.1.3
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966
|
||||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
|
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
|
||||||
|
@ -263,8 +263,8 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE
|
|||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
@ -510,8 +510,9 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
@ -24,7 +24,7 @@ require (
|
|||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||||
github.com/prometheus/client_golang v1.5.1
|
github.com/prometheus/client_golang v1.5.1
|
||||||
github.com/soheilhy/cmux v0.1.5
|
github.com/soheilhy/cmux v0.1.5
|
||||||
github.com/spf13/cobra v1.1.1
|
github.com/spf13/cobra v1.1.3
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
go.etcd.io/bbolt v1.3.6-0.20210426205525-9c92be978ae0
|
||||||
@ -41,5 +41,5 @@ require (
|
|||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
|
||||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
|
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
|
||||||
google.golang.org/grpc v1.37.0
|
google.golang.org/grpc v1.37.0
|
||||||
gopkg.in/yaml.v2 v2.3.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
@ -269,8 +269,8 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE
|
|||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
@ -520,8 +520,8 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
Loading…
Reference in New Issue
Block a user