Documentation ¶
Index ¶
- Constants
- func FormatLocallySupportedParameters() (result string)
- func GetLocallySupportedParameters() []string
- type ComponentSettings
- type EnvInfo
- func (ei *EnvInfo) GetApplication() string
- func (ei *EnvInfo) GetDebugPort() int
- func (ei *EnvInfo) GetLink() []EnvInfoLink
- func (ei *EnvInfo) GetName() string
- func (ei *EnvInfo) GetNamespace() string
- func (ei *EnvInfo) GetPushCommand() EnvInfoPushCommand
- func (ei *EnvInfo) GetRunMode() RUNMode
- func (ei *EnvInfo) GetURL() []EnvInfoURL
- type EnvInfoLink
- type EnvInfoPushCommand
- type EnvInfoURL
- type EnvSpecificInfo
- func (esi *EnvSpecificInfo) DeleteConfiguration(parameter string) error
- func (esi *EnvSpecificInfo) DeleteEnvDirIfEmpty() error
- func (esi *EnvSpecificInfo) DeleteEnvInfoFile() error
- func (esi *EnvSpecificInfo) DeleteLink(parameter string) error
- func (esi *EnvSpecificInfo) DeleteURL(parameter string) error
- func (esi *EnvSpecificInfo) EnvInfoFileExists() bool
- func (esi *EnvSpecificInfo) GetComponentSettings() ComponentSettings
- func (esi *EnvSpecificInfo) IsSet(parameter string) bool
- func (esi *EnvSpecificInfo) SetComponentSettings(cs ComponentSettings) error
- func (esi *EnvSpecificInfo) SetConfiguration(parameter string, value interface{}) (err error)
- func (esi *EnvSpecificInfo) SetRunMode(runMode RUNMode) error
- type LocalConfigProvider
- type RUNMode
- type URLKind
Constants ¶
const ( // Name is the name of the setting controlling the component name Name = "Name" // NameDescription is the human-readable description for name setting NameDescription = "Set this value to user-defined component name to specify the component name" // Namespace is the name of the setting controlling the component namespace Namespace = "Namespace" // NamespaceDescription is the human-readable description for namespace setting NamespaceDescription = "Set this value to user-defined namespace to let the component create under the namespace" // DebugPort is the name of the setting controlling the component debug port DebugPort = "DebugPort" // DebugPortDescription s the human-readable description for debug port setting DebugPortDescription = "Set this value to user-defined debug port to assign the debug port to the component" // URL parameter URL = "URL" // URLDescription is the description of URL URLDescription = "URL to access the component" // Push parameter Push = "PUSH" // PushDescription is the description of push parameter PushDescription = "Push parameter is the action to write devfile commands to env.yaml" // Link parameter Link = "LINK" // LinkDescription is the description of Link LinkDescription = "Link to an Operator backed service" )
Variables ¶
This section is empty.
Functions ¶
func FormatLocallySupportedParameters ¶
func FormatLocallySupportedParameters() (result string)
FormatLocallySupportedParameters outputs supported parameters and their description
func GetLocallySupportedParameters ¶
func GetLocallySupportedParameters() []string
GetLocallySupportedParameters returns the name of the supported global parameters
Types ¶
type ComponentSettings ¶
type ComponentSettings struct { Name string `yaml:"Name,omitempty"` Namespace string `yaml:"Namespace,omitempty"` URL *[]EnvInfoURL `yaml:"Url,omitempty"` PushCommand *EnvInfoPushCommand `yaml:"PushCommand,omitempty"` // AppName is the application name. Application is a virtual concept present in odo used // for grouping of components. A namespace can contain multiple applications AppName string `yaml:"AppName,omitempty" json:"AppName,omitempty"` Link *[]EnvInfoLink `yaml:"Link,omitempty"` // DebugPort controls the port used by the pod to run the debugging agent on DebugPort *int `yaml:"DebugPort,omitempty"` // RunMode indicates the mode of run used for a successful push RunMode *RUNMode `yaml:"RunMode,omitempty"` }
ComponentSettings holds all component related information
type EnvInfo ¶
type EnvInfo struct {
// contains filtered or unexported fields
}
EnvInfo holds all the env specific information relavent to a specific Component.
func GetFakeEnvInfo ¶ added in v1.2.5
func GetFakeEnvInfo(settings ComponentSettings) *EnvInfo
GetFakeEnvInfo gets a fake envInfo using the given componentSettings
func NewEnvInfo ¶
func NewEnvInfo() EnvInfo
NewEnvInfo creates an empty EnvSpecificInfo struct with typeMeta populated
func (*EnvInfo) GetApplication ¶ added in v1.2.4
GetApplication returns the application name
func (*EnvInfo) GetDebugPort ¶ added in v1.2.3
GetDebugPort returns the DebugPort, returns default if nil
func (*EnvInfo) GetLink ¶ added in v1.2.5
func (ei *EnvInfo) GetLink() []EnvInfoLink
GetLink returns the EnvInfoLink, returns default if nil
func (*EnvInfo) GetNamespace ¶ added in v1.1.2
GetNamespace returns component namespace
func (*EnvInfo) GetPushCommand ¶ added in v1.2.2
func (ei *EnvInfo) GetPushCommand() EnvInfoPushCommand
GetPushCommand returns the EnvInfoPushCommand, returns default if nil
func (*EnvInfo) GetRunMode ¶ added in v1.2.5
GetRunMode returns the RunMode, returns default if nil
func (*EnvInfo) GetURL ¶
func (ei *EnvInfo) GetURL() []EnvInfoURL
GetURL returns the EnvInfoURL, returns default if nil
type EnvInfoLink ¶ added in v1.2.5
type EnvInfoPushCommand ¶ added in v1.2.2
type EnvInfoPushCommand struct { Init string `yaml:"Init,omitempty"` Build string `yaml:"Build,omitempty"` Run string `yaml:"Run,omitempty"` }
EnvInfoPushCommand holds the devfile push commands for the component
type EnvInfoURL ¶
type EnvInfoURL struct { // Name of the URL Name string `yaml:"Name,omitempty"` // Port number for the url of the component, required in case of components which expose more than one service port Port int `yaml:"Port,omitempty"` // Indicates if the URL should be a secure https one Secure bool `yaml:"Secure,omitempty"` // Cluster host Host string `yaml:"Host,omitempty"` // TLS secret name to create ingress to provide a secure URL TLSSecret string `yaml:"TLSSecret,omitempty"` // Exposed port number for docker container, required for local scenarios ExposedPort int `yaml:"ExposedPort,omitempty"` // Kind is the kind of the URL Kind URLKind `yaml:"Kind,omitempty"` }
EnvInfoURL holds URL related information
type EnvSpecificInfo ¶
type EnvSpecificInfo struct { Filename string `yaml:"FileName,omitempty"` EnvInfo `yaml:",omitempty"` // contains filtered or unexported fields }
EnvSpecificInfo wraps the envinfo and provides helpers to serialize it.
func NewEnvSpecificInfo ¶
func NewEnvSpecificInfo(envDir string) (*EnvSpecificInfo, error)
NewEnvSpecificInfo retrieves the environment file. If it does not exist, it returns *blank*
func (*EnvSpecificInfo) DeleteConfiguration ¶
func (esi *EnvSpecificInfo) DeleteConfiguration(parameter string) error
DeleteConfiguration is used to delete environment specific info from local odo envinfo
func (*EnvSpecificInfo) DeleteEnvDirIfEmpty ¶
func (esi *EnvSpecificInfo) DeleteEnvDirIfEmpty() error
DeleteEnvDirIfEmpty Deletes the env directory if its empty
func (*EnvSpecificInfo) DeleteEnvInfoFile ¶
func (esi *EnvSpecificInfo) DeleteEnvInfoFile() error
DeleteEnvInfoFile deletes the envinfo.yaml file if it exists
func (*EnvSpecificInfo) DeleteLink ¶ added in v1.2.6
func (esi *EnvSpecificInfo) DeleteLink(parameter string) error
func (*EnvSpecificInfo) DeleteURL ¶
func (esi *EnvSpecificInfo) DeleteURL(parameter string) error
DeleteURL is used to delete environment specific info for url from envinfo
func (*EnvSpecificInfo) EnvInfoFileExists ¶
func (esi *EnvSpecificInfo) EnvInfoFileExists() bool
EnvInfoFileExists if the envinfo file exists or not
func (*EnvSpecificInfo) GetComponentSettings ¶
func (esi *EnvSpecificInfo) GetComponentSettings() ComponentSettings
GetComponentSettings returns the componentSettings from envinfo
func (*EnvSpecificInfo) IsSet ¶
func (esi *EnvSpecificInfo) IsSet(parameter string) bool
IsSet uses reflection to get the parameter from the envinfo struct, currently it only searches the componentSettings
func (*EnvSpecificInfo) SetComponentSettings ¶
func (esi *EnvSpecificInfo) SetComponentSettings(cs ComponentSettings) error
SetComponentSettings sets the componentSettings from to the envinfo and writes to the file
func (*EnvSpecificInfo) SetConfiguration ¶
func (esi *EnvSpecificInfo) SetConfiguration(parameter string, value interface{}) (err error)
SetConfiguration sets the environment specific info such as the Cluster Host, Name, etc. we then **write** this data to the environment yaml file (see envInfoFileName const)
func (*EnvSpecificInfo) SetRunMode ¶ added in v1.2.5
func (esi *EnvSpecificInfo) SetRunMode(runMode RUNMode) error
SetRunMode sets the RunMode in the env file
type LocalConfigProvider ¶ added in v1.2.4
type LocalConfigProvider interface {
GetApplication() string
}
LocalConfigProvider is an interface which all local config providers need to implement currently for openshift there is localConfigInfo and for devfile its EnvInfo. The reason this interface is declared here instead of config package is because some day local config would get deprecated and hence to keep the interfaces in the new package