application

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(client *occlient.Client, appName string) error

Create a new application

func Delete

func Delete(client *occlient.Client, name string) error

Delete deletes the given application

func Exists added in v0.0.2

func Exists(client *occlient.Client, appName string) (bool, error)

Exists returns true if given application (appName) exists

func GetCurrent

func GetCurrent(projectName string) (string, error)

GetCurrent returns currently active application. If no application is active this functions returns empty string

func GetCurrentOrGetCreateSetDefault added in v0.0.4

func GetCurrentOrGetCreateSetDefault(client *occlient.Client) (string, error)

GetCurrentOrGetCreateSetDefault returns currently active application. If no application is active, a defaultApplication is created and set as default as well. Use this carefully only in places where user expects the state to be altered Do not use for read operations like get, list; only for write operations like create

func GetDefaultAppName added in v0.0.15

func GetDefaultAppName(existingApps []config.ApplicationInfo) (string, error)

GetDefaultAppName returns randomly generated application name with unique configurable prefix suffixed by a randomly generated string which can be used as a default name in case the user doesn't provide a name.

func List

func List(client *occlient.Client) ([]config.ApplicationInfo, error)

List all applications in current project

func ListInProject added in v0.0.14

func ListInProject(client *occlient.Client) ([]config.ApplicationInfo, error)

ListInProject lists all applications in given project Queries cluster and config file. Shows also empty applications (empty applications are those that are just mentioned in config file but don't have any object associated with it on cluster).

func SetCurrent added in v0.0.2

func SetCurrent(client *occlient.Client, appName string) error

SetCurrent set application as active

Types

type App added in v0.0.19

type App struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AppSpec   `json:"spec,omitempty"`
	Status            AppStatus `json:"status,omitempty"`
}

Application

type AppList added in v0.0.19

type AppList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []App `json:"items"`
}

AppList is a list of applications

type AppSpec added in v0.0.19

type AppSpec struct {
	Components []string `json:"components,omitempty"`
}

AppSpec is list of components present in given application

type AppStatus added in v0.0.19

type AppStatus struct {
	Active bool `json:"active"`
}

AppStatus shows the application is active or not

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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