Moves config util helpers into their own package. (#3165)

This commit is contained in:
James Phillips 2017-06-20 10:49:37 -07:00 committed by GitHub
parent 280611d407
commit 465f24298e
4 changed files with 19 additions and 17 deletions

View File

@ -9,6 +9,7 @@ import (
"strings"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/configutil"
"github.com/mitchellh/cli"
text "github.com/tonnerre/golang-text"
)
@ -36,16 +37,16 @@ type BaseCommand struct {
hidden *flag.FlagSet
// These are the options which correspond to the HTTP API options
httpAddr StringValue
token StringValue
caFile StringValue
caPath StringValue
certFile StringValue
keyFile StringValue
tlsServerName StringValue
httpAddr configutil.StringValue
token configutil.StringValue
caFile configutil.StringValue
caPath configutil.StringValue
certFile configutil.StringValue
keyFile configutil.StringValue
tlsServerName configutil.StringValue
datacenter StringValue
stale BoolValue
datacenter configutil.StringValue
stale configutil.BoolValue
}
// HTTPClient returns a client with the parsed flags. It panics if the command

View File

@ -7,6 +7,7 @@ import (
"time"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/configutil"
)
type OperatorAutopilotSetCommand struct {
@ -29,12 +30,12 @@ func (c *OperatorAutopilotSetCommand) Synopsis() string {
}
func (c *OperatorAutopilotSetCommand) Run(args []string) int {
var cleanupDeadServers BoolValue
var maxTrailingLogs UintValue
var lastContactThreshold DurationValue
var serverStabilizationTime DurationValue
var redundancyZoneTag StringValue
var disableUpgradeMigration BoolValue
var cleanupDeadServers configutil.BoolValue
var maxTrailingLogs configutil.UintValue
var lastContactThreshold configutil.DurationValue
var serverStabilizationTime configutil.DurationValue
var redundancyZoneTag configutil.StringValue
var disableUpgradeMigration configutil.BoolValue
f := c.BaseCommand.NewFlagSet(c)

View File

@ -1,4 +1,4 @@
package command
package configutil
import (
"fmt"

View File

@ -1,4 +1,4 @@
package command
package configutil
import (
"bytes"