config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 {

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

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) 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) 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(component string, application string, project string) error

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

func (*ConfigInfo) UnsetActiveComponent added in v0.0.4

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

Sets the active component as blank in the configuration file

Jump to

Keyboard shortcuts

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