Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { ID string Name string Discovery discovery.Discovery // (TODO|@amason): after merging #7128, this still requires some additional // work, so deferring this for now! // vtctl vtctldclient.VtctldClient DB vtsql.DB }
Cluster is the self-contained unit of services required for vtadmin to talk to a vitess cluster. This consists of a discovery service, a database connection, and a vtctl client.
type ClustersFlag ¶
ClustersFlag implements flag.Value allowing multiple occurrences of a flag to be accumulated into a map.
func (*ClustersFlag) Set ¶
func (cf *ClustersFlag) Set(value string) error
Set is part of the flag.Value interface. It merges the parsed config into the map, allowing ClustersFlag to power a repeated flag. See (*Config).Set for details on flag parsing.
func (*ClustersFlag) String ¶
func (cf *ClustersFlag) String() string
String is part of the flag.Value interface.
func (*ClustersFlag) Type ¶
func (cf *ClustersFlag) Type() string
Type is part of the pflag.Value interface.
type Config ¶
type Config struct { ID string Name string DiscoveryImpl string DiscoveryFlagsByImpl FlagsByImpl VtSQLFlags map[string]string }
Config represents the options to configure a vtadmin cluster.
func (Config) Merge ¶
Merge returns the result of merging the calling config into the passed config. Neither the caller or the argument are modified in any way.
func (*Config) Set ¶
Set is part of the flag.Value interface. Each flag is parsed according to the following DSN:
id= // ID or shortname of the cluster. name= // Name of the cluster. discovery= // Name of the discovery implementation discovery-.*= // Per-discovery-implementation flags. These are passed to // a given discovery implementation's constructor. vtsql-.*= // VtSQL-specific flags. Further parsing of these is delegated // to the vtsql package.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type FileConfig ¶
FileConfig represents the structure of a set of cluster configs on disk. It contains both a default config, and cluster-specific overrides. Currently only YAML config files are supported.
A valid config looks like:
defaults: discovery: k8s clusters: clusterID1: name: clusterName1 discovery-k8s-some-flag: some-val clusterID2: name: clusterName2 discovery: consul
func (*FileConfig) Combine ¶
func (fc *FileConfig) Combine(defaults Config, clusters map[string]Config) []Config
Combine combines a FileConfig with a default Config and a ClustersFlag (each defined on the command-line) into a slice of final Configs that are suitable to use for cluster creation.
Combination uses the following precedence: 1. Command-line cluster-specific overrides. 2. File-based cluster-specific overrides. 3. Command-line cluster defaults. 4. File-based cluster defaults.
func (*FileConfig) Set ¶
func (fc *FileConfig) Set(value string) error
Set is part of the flag.Value interface. It loads the file configuration found at the path passed to the flag.
func (*FileConfig) String ¶
func (fc *FileConfig) String() string
String is part of the flag.Value interface.
func (*FileConfig) Type ¶
func (fc *FileConfig) Type() string
Type is part of the pflag.Value interface.
func (*FileConfig) UnmarshalYAML ¶
func (fc *FileConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is part of the yaml.Unmarshaler interface.
type FlagsByImpl ¶
FlagsByImpl groups a set of flags by discovery implementation. Its mapping is impl_name=>flag=>value.
Directories
¶
Path | Synopsis |
---|---|
fakediscovery
Package fakediscovery provides a fake, in-memory discovery implementation.
|
Package fakediscovery provides a fake, in-memory discovery implementation. |