Documentation
¶
Index ¶
- func DefaultConfigPath() string
- func SaveConfig(config *Config, path string) error
- type Cluster
- type Config
- func (c *Config) DeleteCluster(name string) bool
- func (c *Config) DeleteContext(name string) bool
- func (c *Config) DeleteUser(name string) bool
- func (c *Config) GetContext(name string) (*ContextConfig, error)
- func (c *Config) GetCurrentContext() (*ContextConfig, error)
- func (c *Config) SetCluster(name string, cluster Cluster)
- func (c *Config) SetContext(name, cluster, user string)
- func (c *Config) SetUser(name string, user User)
- type Context
- type ContextConfig
- type NamedCluster
- type NamedContext
- type NamedUser
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath returns the default config file path
func SaveConfig ¶
SaveConfig saves the configuration to the specified path
Types ¶
type Cluster ¶
type Cluster struct {
Address string `yaml:"address"`
TLSCAPath string `yaml:"tls-ca-path,omitempty"`
TLSCertPath string `yaml:"tls-cert-path,omitempty"`
TLSKeyPath string `yaml:"tls-key-path,omitempty"`
UseLegacyRoutes bool `yaml:"use-legacy-routes,omitempty"`
RulerAPIPath string `yaml:"ruler-api-path,omitempty"`
}
Cluster contains cluster connection information
type Config ¶
type Config struct {
CurrentContext string `yaml:"current-context"`
Contexts []NamedContext `yaml:"contexts"`
Clusters []NamedCluster `yaml:"clusters"`
Users []NamedUser `yaml:"users"`
}
Config represents the cortextool configuration file structure
func LoadConfig ¶
LoadConfig loads the configuration from the specified path
func (*Config) DeleteCluster ¶
DeleteCluster removes a cluster
func (*Config) DeleteContext ¶
DeleteContext removes a context
func (*Config) GetContext ¶
func (c *Config) GetContext(name string) (*ContextConfig, error)
GetContext returns a specific context by name
func (*Config) GetCurrentContext ¶
func (c *Config) GetCurrentContext() (*ContextConfig, error)
GetCurrentContext returns the merged configuration for the current context
func (*Config) SetCluster ¶
SetCluster creates or updates a cluster
func (*Config) SetContext ¶
SetContext creates or updates a context
type ContextConfig ¶
type ContextConfig struct {
Address string
TLSCAPath string
TLSCertPath string
TLSKeyPath string
UseLegacyRoutes bool
RulerAPIPath string
ID string
User string
Key string
AuthToken string
}
ContextConfig represents the merged configuration from a specific context
type NamedCluster ¶
NamedCluster associates a name with a cluster
type NamedContext ¶
NamedContext associates a name with a context