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

View File

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

View File

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

View File

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