Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func FormatSupportedParameters() (result string)
 - func GetSupportedParameters() []string
 - type OdoSettings
 - type Preference
 - type PreferenceInfo
 - func (c *PreferenceInfo) DeleteConfiguration(parameter string) error
 - func (c *PreferenceInfo) GetNamePrefix() string
 - func (c *PreferenceInfo) GetTimeout() int
 - func (c *PreferenceInfo) GetUpdateNotification() bool
 - func (c *PreferenceInfo) IsSet(parameter string) bool
 - func (c *PreferenceInfo) SetConfiguration(parameter string, value string) error
 
Constants ¶
const ( //DefaultTimeout for openshift server connection check DefaultTimeout = 1 // UpdateNotificationSetting is the name of the setting controlling update notification UpdateNotificationSetting = "UpdateNotification" // UpdateNotificationSettingDescription is human-readable description for the update notification setting UpdateNotificationSettingDescription = "Flag to control if an update notification is shown or not (Default: true)" // NamePrefixSetting is the name of the setting controlling name prefix NamePrefixSetting = "NamePrefix" // NamePrefixSettingDescription is human-readable description for the name prefix setting NamePrefixSettingDescription = "Use this value to set a default name prefix (Default: current directory name)" // TimeoutSetting is the name of the setting controlling timeout for connection check TimeoutSetting = "Timeout" )
Variables ¶
var TimeoutSettingDescription = fmt.Sprintf("Timeout (in seconds) for OpenShift server connection check (Default: %d)", DefaultTimeout)
    TimeoutSettingDescription is human-readable description for the timeout setting
Functions ¶
func FormatSupportedParameters ¶
func FormatSupportedParameters() (result string)
FormatSupportedParameters outputs supported parameters and their description
func GetSupportedParameters ¶
func GetSupportedParameters() []string
GetSupportedParameters returns the name of the supported parameters
Types ¶
type OdoSettings ¶
type OdoSettings struct {
	// Controls if an update notification is shown or not
	UpdateNotification *bool `yaml:"UpdateNotification,omitempty"`
	// Holds the prefix part of generated random application name
	NamePrefix *string `yaml:"NamePrefix,omitempty"`
	// Timeout for openshift server connection check
	Timeout *int `yaml:"Timeout,omitempty"`
}
    OdoSettings holds all odo specific configurations
type Preference ¶
type Preference struct {
	metav1.TypeMeta `yaml:",inline"`
	// Odo settings holds the odo specific global settings
	OdoSettings OdoSettings `yaml:"OdoSettings,omitempty"`
}
    Preference stores all the preferences related to odo
func NewPreference ¶
func NewPreference() Preference
NewPreference creates an empty Preference struct with type meta information
type PreferenceInfo ¶
type PreferenceInfo struct {
	Filename   string `yaml:"FileName,omitempty"`
	Preference `yaml:",omitempty"`
}
    PreferenceInfo wraps the preference and provides helpers to serialize it.
func New ¶
func New() (*PreferenceInfo, error)
New returns the PreferenceInfo to retain the expected behavior
func NewPreferenceInfo ¶
func NewPreferenceInfo() (*PreferenceInfo, error)
NewPreferenceInfo gets the PreferenceInfo from preference file and creates the preference file in case it's not present
func (*PreferenceInfo) DeleteConfiguration ¶
func (c *PreferenceInfo) DeleteConfiguration(parameter string) error
DeleteConfiguration delete Odo configurations in the global config file as of now being used for nameprefix, timeout, updatenotification
func (*PreferenceInfo) GetNamePrefix ¶
func (c *PreferenceInfo) GetNamePrefix() string
GetNamePrefix returns the value of Prefix from config and if absent then returns default
func (*PreferenceInfo) GetTimeout ¶
func (c *PreferenceInfo) GetTimeout() int
GetTimeout returns the value of Timeout from config and if absent then returns default
func (*PreferenceInfo) GetUpdateNotification ¶
func (c *PreferenceInfo) GetUpdateNotification() bool
GetUpdateNotification returns the value of UpdateNotification from config and if absent then returns default
func (*PreferenceInfo) IsSet ¶
func (c *PreferenceInfo) IsSet(parameter string) bool
IsSet checks if the value is set in the preference
func (*PreferenceInfo) SetConfiguration ¶
func (c *PreferenceInfo) SetConfiguration(parameter string, value string) error
SetConfiguration modifies Odo configurations in the config file as of now being used for nameprefix, timeout, updatenotification TODO: Use reflect to set parameters