cmd

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GlobalFlags are flags what all commands have common
	GlobalFlags = []cli.Flag{
		cli.BoolFlag{
			Name:  "debug",
			Usage: "enable debug output in logs",
		},
		cli.BoolFlag{
			Name:  "quiet",
			Usage: "Don't print any progress output",
		},
		cli.StringFlag{
			Name:  "output, o",
			Usage: fmt.Sprintf("Output format. One of: %s", []string{outputHuman, outputYaml}),
			Value: "human",
		},
	}
)

Functions

func DropDoubleDash added in v0.2.3

func DropDoubleDash(args []string) []string

DropDoubleDash search for double dash (--) and if found return arguments after it, otherwise return all arguments

func FilterByPodName

func FilterByPodName(source []*pods.Pod, podName string) []*pods.Pod

FilterByPodName return new list of Pods which name matches with given podName

func FindRunningContainerID added in v0.2.4

func FindRunningContainerID(pod *pods.Pod, name string) (string, error)

FindRunningContainerID search from Pod definition a containerID by container name

func First added in v0.2.0

func First(values ...string) string

First return first non empty "" string or empty ""

func ForwardAllSignals

func ForwardAllSignals(handler func(syscall.Signal) error) chan os.Signal

ForwardAllSignals will listen all kill signals and pass it to the handler

func GetClient

func GetClient(config *config.Provider) *api.Client

GetClient creates new cloud API client

func GetConfig

func GetConfig(clicontext *cli.Context) *config.Config

GetConfig parse yaml config and return the file representation In normal cases, you should use GetConfigProvider

func GetConfigProvider

func GetConfigProvider(clicontext *cli.Context) *config.Provider

GetConfigProvider return config.Provider to access the current configuration

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory resolves current directory where the command were executed Tries different options until find one or fails

func GetLabels

func GetLabels(clicontext *cli.Context) map[string]string

GetLabels return --labels CLI parameter value as string map

func GetPrinter

func GetPrinter(clicontext *cli.Context) printers.ResourcePrinter

GetPrinter returns printer for formating resources output

func GetRuntimeClient

func GetRuntimeClient(clicontext *cli.Context, hostname string) runtime.Client

GetRuntimeClient initialises new runtime client from CLI parameters

func GlobalBefore

func GlobalBefore(context *cli.Context) error

GlobalBefore is function what get executed before any commands executes

func MustParseBindFlag

func MustParseBindFlag(b string) *containers.Mount

MustParseBindFlag is like ParseBindFlag but panics if syntax is invalid

func MustParseBinds added in v0.2.4

func MustParseBinds(binds []string) (result []*containers.Mount)

MustParseBinds parses a --bind string flags

func MustParseMounts added in v0.2.4

func MustParseMounts(mounts []string) (result []*containers.Mount)

MustParseMounts parses a --mount string flags

func MustParseSyncs added in v0.2.4

func MustParseSyncs(syncs []string) (result []sync.Sync)

MustParseSyncs parses a sync string in the form "~/local/dir:/data"

func ParseBindFlag

func ParseBindFlag(b string) (*containers.Mount, error)

ParseBindFlag parses a mount string in the form "/var:/var:rshared"

func ResolveContainerID added in v0.2.3

func ResolveContainerID(containers []*containers.ContainerStatus, containerName string) (string, error)

ResolveContainerID resolves ContainerID from list of containers. If multiple containers, you must define containerName, otherwise it's optional.

func ShowDownloadProgress added in v0.2.4

func ShowDownloadProgress(progressc <-chan []*progress.ImageFetch)

ShowDownloadProgress prints UI "downloading" lines and updates until the progress channel closes

func StopCatch added in v0.2.4

func StopCatch(sigc chan os.Signal)

StopCatch will close the given channel when receives Stop signal (^C)

func UpdateConfig

func UpdateConfig(clicontext *cli.Context, updated *config.Config) error

UpdateConfig writes config to the config file in yaml format

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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