Documentation
¶
Overview ¶
Package flags holds common flags that are shared between our commands.
Index ¶
- Constants
- func Merge(dst, src *flag.FlagSet)
- func ToSet(s []string) mapset.Set
- func Usage(txt string, flags *flag.FlagSet) string
- type AppendSliceValue
- type ConsulACLFlags
- type ConsulFlags
- type ConsulLoginFlags
- type ConsulTLSFlags
- type DurationValue
- type FlagMapValue
- type HTTPFlags
- func (f *HTTPFlags) APIClient() (*api.Client, error)
- func (f *HTTPFlags) Addr() string
- func (f *HTTPFlags) ConsulAPITimeout() time.Duration
- func (f *HTTPFlags) Flags() *flag.FlagSet
- func (f *HTTPFlags) MergeOntoConfig(c *api.Config)
- func (f *HTTPFlags) Partition() string
- func (f *HTTPFlags) ReadTokenFile() (string, error)
- func (f *HTTPFlags) SetToken(v string) error
- func (f *HTTPFlags) SetTokenFile(v string) error
- func (f *HTTPFlags) TLSServerName() string
- func (f *HTTPFlags) Token() string
- func (f *HTTPFlags) TokenFile() string
- type K8SFlags
- type StringValue
- type Usager
Constants ¶
const ( AddressesEnvVar = "CONSUL_ADDRESSES" GRPCPortEnvVar = "CONSUL_GRPC_PORT" HTTPPortEnvVar = "CONSUL_HTTP_PORT" NamespaceEnvVar = "CONSUL_NAMESPACE" PartitionEnvVar = "CONSUL_PARTITION" DatacenterEnvVar = "CONSUL_DATACENTER" ACLTokenEnvVar = "CONSUL_ACL_TOKEN" ACLTokenFileEnvVar = "CONSUL_ACL_TOKEN_FILE" LoginAuthMethodEnvVar = "CONSUL_LOGIN_AUTH_METHOD" LoginBearerTokenFileEnvVar = "CONSUL_LOGIN_BEARER_TOKEN_FILE" LoginDatacenterEnvVar = "CONSUL_LOGIN_DATACENTER" LoginPartitionEnvVar = "CONSUL_LOGIN_PARTITION" LoginNamespaceEnvVar = "CONSUL_LOGIN_NAMESPACE" LoginMetaEnvVar = "CONSUL_LOGIN_META" SkipServerWatchEnvVar = "CONSUL_SKIP_SERVER_WATCH" APITimeoutEnvVar = "CONSUL_API_TIMEOUT" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppendSliceValue ¶
type AppendSliceValue []string
AppendSliceValue implements the flag.Value interface and allows multiple calls to the same variable to append a list.
func (*AppendSliceValue) Set ¶
func (s *AppendSliceValue) Set(value string) error
func (*AppendSliceValue) String ¶
func (s *AppendSliceValue) String() string
type ConsulACLFlags ¶
type ConsulACLFlags struct { ConsulLogin ConsulLoginFlags Token string TokenFile string }
type ConsulFlags ¶
type ConsulFlags struct { Addresses string GRPCPort int HTTPPort int APITimeout time.Duration Namespace string Partition string Datacenter string SkipServerWatch bool ConsulTLSFlags ConsulACLFlags }
ConsulFlags is a set of flags used to connect to Consul (servers).
func (*ConsulFlags) ConsulClientConfig ¶
func (f *ConsulFlags) ConsulClientConfig() *consul.Config
func (*ConsulFlags) ConsulServerConnMgrConfig ¶
func (f *ConsulFlags) ConsulServerConnMgrConfig() (discovery.Config, error)
func (*ConsulFlags) Flags ¶
func (f *ConsulFlags) Flags() *flag.FlagSet
type ConsulLoginFlags ¶
type ConsulTLSFlags ¶
type DurationValue ¶
type DurationValue struct {
// contains filtered or unexported fields
}
DurationValue provides a flag value that's aware if it has been set.
func (*DurationValue) Duration ¶
func (d *DurationValue) Duration() time.Duration
String implements the flag.Value interface.
func (*DurationValue) Merge ¶
func (d *DurationValue) Merge(onto *time.Duration)
Merge will overlay this value if it has been set.
func (*DurationValue) Set ¶
func (d *DurationValue) Set(v string) error
Set implements the flag.Value interface.
func (*DurationValue) String ¶
func (d *DurationValue) String() string
String implements the flag.Value interface.
type FlagMapValue ¶
FlagMapValue is a flag implementation used to provide key=value semantics multiple times.
func (*FlagMapValue) Set ¶
func (h *FlagMapValue) Set(value string) error
func (*FlagMapValue) String ¶
func (h *FlagMapValue) String() string
type HTTPFlags ¶
type HTTPFlags struct {
// contains filtered or unexported fields
}
HTTPFlags are flags used to configure communication with a Consul agent.
func (*HTTPFlags) ConsulAPITimeout ¶
func (*HTTPFlags) MergeOntoConfig ¶
func (*HTTPFlags) ReadTokenFile ¶
func (*HTTPFlags) SetTokenFile ¶
func (*HTTPFlags) TLSServerName ¶
type K8SFlags ¶
type K8SFlags struct {
// contains filtered or unexported fields
}
func (*K8SFlags) KubeConfig ¶
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
StringValue provides a flag value that's aware if it has been set.
func (*StringValue) Merge ¶
func (s *StringValue) Merge(onto *string)
Merge will overlay this value if it has been set.
func (*StringValue) Set ¶
func (s *StringValue) Set(v string) error
Set implements the flag.Value interface.
func (*StringValue) String ¶
func (s *StringValue) String() string
String implements the flag.Value interface.