preference

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//DefaultTimeout for openshift server connection check (in seconds)
	DefaultTimeout = 1

	// DefaultPushTimeout is the default timeout for pods (in seconds)
	DefaultPushTimeout = 240

	// 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"

	// PushTimeoutSetting is the name of the setting controlling PushTimeout
	PushTimeoutSetting = "PushTimeout"
)

Variables

View Source
var PushTimeoutSettingDescription = fmt.Sprintf("PushTimeout (in seconds) for waiting for a Pod to come up (Default: %d)", DefaultPushTimeout)

PushTimeoutSettingDescription adds a description for PushTimeout

View Source
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"`

	// PushTimeout for OpenShift pod timeout check
	PushTimeout *int `yaml:"PushTimeout,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) GetPushTimeout added in v1.0.2

func (c *PreferenceInfo) GetPushTimeout() int

GetPushTimeout gets the value set by PushTimeout

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