Documentation ¶
Index ¶
- func ConfigureViper(contextOverride string) error
- func DeleteClusterConfiguration(configDir, clusterName string) error
- func DeleteContextConfiguration(configDir, contextName string) error
- func GetConfigDir() string
- func GetDefaultConfigDir() string
- func ListClusterConfigurations(configDir string) ([]string, error)
- func ListContextConfigurations(configDir string) ([]string, error)
- func LoadBundleToDirectory(bundle Bundle, configDir string, clusters, contexts []string, overwrite bool) error
- func SaveBaseConfiguration(configDir string, configuration BaseConfigFile) error
- func SaveClusterConfiguration(configDir, clusterName string, configuration ClusterFile, overwrite bool) error
- func SaveContextConfiguration(configDir, contextName string, configuration ContextFile, overwrite bool) error
- type BaseConfigFile
- type Bundle
- type ClusterFile
- type ContextFile
- type HousekeepingConfiguration
- type IndividualURLsConfiguration
- type RealmConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureViper ¶
ConfigureViper sets up Viper to behave correctly with regards to both context and configuration directory, taking into account all environment variables and parameters. Order of precedence is: override, environment variables, defaults
func DeleteClusterConfiguration ¶
DeleteClusterConfiguration deletes a cluster configuration in the config directory. It will return an error if the cluster does not exist. The operation cannot be reverted
func DeleteContextConfiguration ¶
DeleteContextConfiguration deletes a context configuration in the config directory. It will return an error if the context does not exist. The operation cannot be reverted
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the Config Dir based on the current status
func GetDefaultConfigDir ¶
func GetDefaultConfigDir() string
GetDefaultConfigDir returns the default config directory
func ListClusterConfigurations ¶
ListClusterConfigurations returns a list of available cluster configurations
func ListContextConfigurations ¶
ListContextConfigurations returns a list of available context configurations
func LoadBundleToDirectory ¶
func LoadBundleToDirectory(bundle Bundle, configDir string, clusters, contexts []string, overwrite bool) error
LoadBundleToDirectory loads a bundle into a config directory, overwriting matching files, overwriting any overlapping entry. When failing, it might have partially loaded some of the entries in the file. Clusters and Contexts, when specified, are a list of clusters and contexts to load. An empty list means "all"
func SaveBaseConfiguration ¶
func SaveBaseConfiguration(configDir string, configuration BaseConfigFile) error
SaveBaseConfiguration saves the base configuration in a config directory
func SaveClusterConfiguration ¶
func SaveClusterConfiguration(configDir, clusterName string, configuration ClusterFile, overwrite bool) error
SaveClusterConfiguration saves a cluster configuration in the config directory
func SaveContextConfiguration ¶
func SaveContextConfiguration(configDir, contextName string, configuration ContextFile, overwrite bool) error
SaveContextConfiguration saves a context configuration in the config directory
Types ¶
type BaseConfigFile ¶
type BaseConfigFile struct { // CurrentContext represents the context which should be used when no context is explicitly specified CurrentContext string `yaml:"context" json:"context"` }
BaseConfigFile represents a base configuration for astartectl
func LoadBaseConfiguration ¶
func LoadBaseConfiguration(configDir string) (BaseConfigFile, error)
LoadBaseConfiguration loads the base configuration from a config directory
type Bundle ¶
type Bundle struct { // BaseConfig is the base config for astartectl BaseConfig BaseConfigFile `yaml:"config" json:"config"` // Clusters is the list of available clusters Clusters map[string]ClusterFile `yaml:"clusters" json:"clusters"` // Contexts is the list of available contexts Contexts map[string]ContextFile `yaml:"contexts" json:"contexts"` }
Bundle represents a bundle encapsulating all configuration files
func CreateBundleFromDirectory ¶
CreateBundleFromDirectory returns a bundle out of a config directory Clusters and Contexts, when specified, are a list of clusters and contexts to save. An empty list means "all"
type ClusterFile ¶
type ClusterFile struct { // URL is the base API URL for the Cluster. Can be omitted when specifying individual URLs URL string `yaml:"url,omitempty" json:"url,omitempty"` // Housekeeping is the Cluster's Housekeeping configuration. Can be omitted if there is no such information Housekeeping HousekeepingConfiguration `yaml:"housekeeping,omitempty" json:"housekeeping,omitempty"` // IndividualURLs are the Cluster's individual API URLs. Should usually be omitted, and URL should // be used instead, but in case of exotic API server setups they are required. When specified, they // take precedence over URL IndividualURLs IndividualURLsConfiguration `yaml:"individual-urls,omitempty" json:"individual-urls,omitempty"` }
ClusterFile represents a Cluster file
func LoadClusterConfiguration ¶
func LoadClusterConfiguration(configDir, clusterName string) (ClusterFile, error)
LoadClusterConfiguration loads a cluster configuration from the config directory
type ContextFile ¶
type ContextFile struct { // Cluster is the name of the cluster. It has to match an existing Cluster configuration Cluster string `yaml:"cluster" json:"cluster"` // Realm is the realm object. In case the Context refers to Housekeeping only, can be omitted Realm RealmConfiguration `yaml:"realm,omitempty" json:"realm,omitempty"` }
ContextFile represents a Context file
func LoadContextConfiguration ¶
func LoadContextConfiguration(configDir, contextName string) (ContextFile, error)
LoadContextConfiguration loads a context configuration from the config directory
type HousekeepingConfiguration ¶
type HousekeepingConfiguration struct { // Key is the private key of the realm, encoded in base64 Key string `yaml:"key,omitempty" json:"key,omitempty"` // Token is a token used to authenticate against the realm. When set, it takes precedence over key Token string `yaml:"token,omitempty" json:"token,omitempty"` }
HousekeepingConfiguration represents configuration for housekeeping
type IndividualURLsConfiguration ¶
type IndividualURLsConfiguration struct { // AppEngine is AppEngine API URL AppEngine string `yaml:"appengine,omitempty" json:"appengine,omitempty"` // Flow is Flow API URL Flow string `yaml:"flow,omitempty" json:"flow,omitempty"` // Housekeeping is Housekeeping API URL Housekeeping string `yaml:"housekeeping,omitempty" json:"housekeeping,omitempty"` // Pairing is Pairing API URL Pairing string `yaml:"pairing,omitempty" json:"pairing,omitempty"` // RealmManagement is Realm Management API URL RealmManagement string `yaml:"realm-management,omitempty" json:"realm-management,omitempty"` }
IndividualURLsConfiguration represents configuration for Individual URLs. When present, URL is overridden and not used.
type RealmConfiguration ¶
type RealmConfiguration struct { // Name is the name of the realm Name string `yaml:"name" json:"name"` // Key is the private key of the realm, encoded in base64. Can be omitted Key string `yaml:"key,omitempty" json:"key,omitempty"` // Token is a token used to authenticate against the realm. When set, it takes precedence over key Token string `yaml:"token,omitempty" json:"token,omitempty"` }
RealmConfiguration represents configuration for a Realm