config

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 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
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInfo added in v0.0.2

type ApplicationInfo struct {
	// name of the application
	Name string `json:"name"`
	// is this application active? Only one application can be active at the time
	Active bool `json:"active"`
	// name of the openshift project this application belongs to
	Project string `json:"project"`
	// last active component for  this application
	ActiveComponent string `json:"activeComponent"`
}

ApplicationInfo holds all important information about one application

type Config

type Config struct {
	// odo specific configuration settings
	OdoSettings OdoSettings `json:"settings"`

	// Currently active application
	// multiple applications can be active but each one has to be in different project
	// there shouldn't be more active applications in one project
	ActiveApplications []ApplicationInfo `json:"activeApplications"`
}

type ConfigInfo

type ConfigInfo struct {
	Filename string
	Config
}

func New

func New() (*ConfigInfo, error)

New gets the configInfo from config file and creates the config file in case it's not present then it

func (*ConfigInfo) AddApplication added in v0.0.3

func (c *ConfigInfo) AddApplication(application string, project string) error

AddApplication add new application to the config file Newly create application is NOT going to be se as Active.

func (*ConfigInfo) DeleteApplication added in v0.0.2

func (c *ConfigInfo) DeleteApplication(application string, project string) error

DeleteApplication deletes application from given project from config file

func (*ConfigInfo) DeleteProject added in v0.0.15

func (c *ConfigInfo) DeleteProject(projectName string) error

DeleteProject deletes applications belonging to the given project from the config file

func (*ConfigInfo) GetActiveApplication added in v0.0.2

func (c *ConfigInfo) GetActiveApplication(project string) string

GetActiveApplication get currently active application for given project if no application is active return empty string

func (*ConfigInfo) GetActiveComponent

func (c *ConfigInfo) GetActiveComponent(application string, project string) string

GetActiveComponent if no component is set as current returns empty string

func (*ConfigInfo) GetNamePrefix added in v0.0.15

func (c *ConfigInfo) GetNamePrefix() string

GetNamePrefix returns the value of Prefix from config

func (*ConfigInfo) GetTimeout added in v0.0.15

func (c *ConfigInfo) GetTimeout() int

GetTimeout returns the value of Timeout from config

func (*ConfigInfo) GetUpdateNotification added in v0.0.11

func (c *ConfigInfo) GetUpdateNotification() bool

GetUpdateNotification returns the value of UpdateNotification from config

func (*ConfigInfo) SetActiveApplication added in v0.0.2

func (c *ConfigInfo) SetActiveApplication(application string, project string) error

SetActiveApplication set application as active for given project

func (*ConfigInfo) SetActiveComponent

func (c *ConfigInfo) SetActiveComponent(componentName string, applicationName string, projectName string) error

SetActiveComponent sets active component for given project and application. application must exist

func (*ConfigInfo) SetConfiguration added in v0.0.11

func (c *ConfigInfo) SetConfiguration(parameter string, value string) error

SetConfiguration modifies Odo configurations in the config file as of now being used for nameprefix, timeout, updatenotification

func (*ConfigInfo) UnsetActiveApplication added in v0.0.14

func (c *ConfigInfo) UnsetActiveApplication(project string) error

UnsetActiveApplication sets the active application as blank of the given project in the configuration file

func (*ConfigInfo) UnsetActiveComponent added in v0.0.4

func (c *ConfigInfo) UnsetActiveComponent(project string) error

UnsetActiveComponent sets the active component as blank of the given project in the configuration file

type OdoSettings added in v0.0.11

type OdoSettings struct {
	// Controls if an update notification is shown or not
	UpdateNotification *bool `json:"updatenotification,omitempty"`
	// Holds the prefix part of generated random application name
	NamePrefix *string `json:"nameprefix,omitempty"`
	// Timeout for openshift server connection check
	Timeout *int `json:"timeout,omitempty"`
}

OdoSettings holds all odo specific configurations

Jump to

Keyboard shortcuts

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