preference

package
v1.0.0-beta4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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 = "Controls if an update notification is shown or not (true or false)"
	// NamePrefixSetting is the name of the setting controlling name prefix
	NamePrefixSetting = "NamePrefix"
	// NamePrefixSettingDescription is human-readable description for the name prefix setting
	NamePrefixSettingDescription = "Default prefix is the current directory name. Use this value to set a default name prefix"
	// TimeoutSetting is the name of the setting controlling timeout for connection check
	TimeoutSetting = "Timeout"
	// TimeoutSettingDescription is human-readable description for the timeout setting
	TimeoutSettingDescription = "Timeout (in seconds) for OpenShift server connection check"
)

Variables

This section is empty.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL