mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Moves config util helpers into their own package. (#3165)
This commit is contained in:
parent
b083ce17c7
commit
902f1ce16f
@ -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
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package command
|
package configutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package command
|
package configutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
Loading…
x
Reference in New Issue
Block a user