component

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build added in v0.0.5

func Build(client *occlient.Client, componentName string, applicationName string, streamLogs bool, wait bool, stdout io.Writer) error

Build component from BuildConfig. If 'streamLogs' is true than it streams build logs on stdout, set 'wait' to true if you want to return error if build fails. If 'wait' is true than it waits for build to successfully complete. If 'wait' is false than this function won't return error even if build failed.

func CreateFromGit

func CreateFromGit(client *occlient.Client, name string, ctype string, url string, applicationName string) error

func CreateFromPath added in v0.0.5

func CreateFromPath(client *occlient.Client, name string, ctype string, path string, applicationName string, sourceType string) error

CreateFromPath create new component with source or binary from the given local path sourceType indicates the source type of the component and can be either local or binary

func Delete

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

Delete whole component

func Exists added in v0.0.4

func Exists(client *occlient.Client, componentName, applicationName, projectName string) (bool, error)

Checks whether a component with the given name exists in the current application or not componentName is the component name to perform check for The first returned parameter is a bool indicating if a component with the given name already exists or not The second returned parameter is the error that might occurs while execution

func GetComponentDesc added in v0.0.4

func GetComponentDesc(client *occlient.Client, currentComponent string, currentApplication string, currentProject string) (componentType string, path string, componentURL string, appStore []storage.StorageInfo, err error)

Get Component Description

func GetComponentSource added in v0.0.3

func GetComponentSource(client *occlient.Client, componentName string, applicationName string, projectName string) (string, string, error)

GetComponentSource what source type given component uses The first returned string is component source type ("git" or "local" or "binary") The second returned string is a source (url to git repository or local path or path to binary)

func GetComponentType added in v0.0.3

func GetComponentType(client *occlient.Client, componentName string, applicationName string, projectName string) (string, error)

GetComponentType returns type of component in given application and project

func GetCurrent

func GetCurrent(client *occlient.Client, applicationName string, projectName string) (string, error)

GetCurrent component in active application returns "" if there is no active component

func GetLogs added in v0.0.6

func GetLogs(client *occlient.Client, componentName string, applicationName string, follow bool, stdout io.Writer) error

Get Component logs follow the DeploymentConfig logs if follow is set to true

func PushLocal added in v0.0.3

func PushLocal(client *occlient.Client, componentName string, applicationName string, path string, asFile bool, out io.Writer) error

PushLocal push local code to the cluster and trigger build there. asFile indicates if it is a binary component or not

func SetCurrent

func SetCurrent(client *occlient.Client, name string, applicationName string, projectName string) error

func Update added in v0.0.4

func Update(client *occlient.Client, componentName string, applicationName string, to string, source string) error

Update updates the requested component Component name is the name component to be updated to indicates what type of source type the component source is changing to e.g from git to local or local to binary source indicates path of the source directory or binary or the git URL

func WatchAndPush added in v0.0.4

func WatchAndPush(client *occlient.Client, componentName string, applicationName, path string, asFile bool, out io.Writer) error

WatchAndPush watches path, if something changes in that path it calls PushLocal ignores .git/* by default inspired by https://github.com/openshift/origin/blob/e785f76194c57bd0e1674c2f2776333e1e0e4e78/pkg/oc/cli/cmd/rsync/rsync.go#L257

Types

type ComponentInfo added in v0.0.3

type ComponentInfo struct {
	Name string
	Type string
}

ComponentInfo holds all important information about one component

func List added in v0.0.3

func List(client *occlient.Client, applicationName string, projectName string) ([]ComponentInfo, error)

List lists components in active application

type LinkInfo added in v0.0.4

type LinkInfo struct {
	SourceComponent string
	TargetComponent string
	Envs            []string
}

LinkInfo contains the information about the link being created between components

func Link(client *occlient.Client, sourceComponent, targetComponent, applicationName string) (*LinkInfo, error)

Link injects connection information of the target component into the source component as environment variables

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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