diff --git a/command/base.go b/command/base.go index 2296fd8e0..e8e24c5a8 100644 --- a/command/base.go +++ b/command/base.go @@ -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 diff --git a/command/operator_autopilot_set.go b/command/operator_autopilot_set.go index 621360fc9..53df6945c 100644 --- a/command/operator_autopilot_set.go +++ b/command/operator_autopilot_set.go @@ -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) diff --git a/command/config_util.go b/configutil/config.go similarity index 99% rename from command/config_util.go rename to configutil/config.go index 82ea430e6..786914aac 100644 --- a/command/config_util.go +++ b/configutil/config.go @@ -1,4 +1,4 @@ -package command +package configutil import ( "fmt" diff --git a/command/config_util_test.go b/configutil/config_test.go similarity index 99% rename from command/config_util_test.go rename to configutil/config_test.go index 46144c52d..03870cbe1 100644 --- a/command/config_util_test.go +++ b/configutil/config_test.go @@ -1,4 +1,4 @@ -package command +package configutil import ( "bytes"