cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Redacted = "REDACTED"
	Empty    = "EMPTY"
)
View Source
const (
	KubectlCmd  = "kubectl"
	HelmCmd     = "helm"
	GcloudCmd   = "gcloud"
	MinikubeCmd = "minikube"
	EksCtlCmd   = "eksctl"
)
View Source
const (
	Decrypt = "decrypt"
)

Variables

View Source
var (
	CommandError = func(err error) error {
		return errors.Wrapf(err, "command error")
	}
)

Functions

func PromptPressAnyKeyToContinue

func PromptPressAnyKeyToContinue(nextStep string) error

Types

type Command

type Command struct {
	Name  string
	Args  []string
	StdIn string

	PrintCommands   bool
	Redactions      map[string]string
	SwallowErrorLog bool
}

func (*Command) Redact

func (c *Command) Redact(unredacted, redacted string) *Command

func (*Command) ToString

func (c *Command) ToString() string

func (*Command) With

func (c *Command) With(args ...string) *Command

func (*Command) WithStdIn

func (c *Command) WithStdIn(stdIn string) *Command

type CommandFactory

type CommandFactory struct {
	LocalPathOverride map[string]string
}

func (*CommandFactory) EksCtl

func (c *CommandFactory) EksCtl() *EksCtl

func (*CommandFactory) Gcloud

func (c *CommandFactory) Gcloud() *Gcloud

func (*CommandFactory) Kubectl

func (c *CommandFactory) Kubectl() *Kubectl

func (*CommandFactory) Minikube

func (c *CommandFactory) Minikube() *Minikube

func (*CommandFactory) SetLocalPath

func (c *CommandFactory) SetLocalPath(path, localPath string)

type CommandStreamHandler

type CommandStreamHandler struct {
	WaitFunc func() error
	Stdout   io.Reader
	Stderr   io.Reader
	Process  *exec.Cmd
}

func (*CommandStreamHandler) StreamHelper

func (c *CommandStreamHandler) StreamHelper(inputErr error) error

type EksCtl

type EksCtl struct {
	// contains filtered or unexported fields
}

func (*EksCtl) Cmd

func (e *EksCtl) Cmd() *Command

func (*EksCtl) CreateCluster

func (e *EksCtl) CreateCluster(name, region string, runner Runner) error

func (*EksCtl) DeleteCluster

func (e *EksCtl) DeleteCluster(name, region string, runner Runner) error

func (*EksCtl) GetCluster

func (e *EksCtl) GetCluster() *EksCtl

func (*EksCtl) GetCredentials

func (e *EksCtl) GetCredentials() *EksCtl

func (*EksCtl) IsRunning

func (e *EksCtl) IsRunning(name, region string, runner Runner) (bool, error)

func (*EksCtl) Name

func (e *EksCtl) Name(name string) *EksCtl

func (*EksCtl) Region

func (e *EksCtl) Region(region string) *EksCtl

func (*EksCtl) SwallowError

func (e *EksCtl) SwallowError() *EksCtl

func (*EksCtl) With

func (e *EksCtl) With(args ...string) *EksCtl

func (*EksCtl) WithName

func (e *EksCtl) WithName(name string) *EksCtl

func (*EksCtl) WriteKubeConfig

func (e *EksCtl) WriteKubeConfig(name, region string, runner Runner) error

type Factory

type Factory interface {
	SetLocalPath(path, localPath string)
	Kubectl() *Kubectl
	Gcloud() *Gcloud
	Minikube() *Minikube
	EksCtl() *EksCtl
}

func New

func New() Factory

type Gcloud

type Gcloud struct {
	// contains filtered or unexported fields
}

func (*Gcloud) Ciphertext

func (g *Gcloud) Ciphertext(cipherText string) *Gcloud

func (*Gcloud) Cmd

func (g *Gcloud) Cmd() *Command

func (*Gcloud) DecryptFile

func (g *Gcloud) DecryptFile(cipherText, plainText, project, keyring, key string) *Gcloud

func (*Gcloud) GetCredentials

func (g *Gcloud) GetCredentials() *Gcloud

func (*Gcloud) Global

func (g *Gcloud) Global() *Gcloud

func (*Gcloud) Key

func (g *Gcloud) Key(key string) *Gcloud

func (*Gcloud) Keyring

func (g *Gcloud) Keyring(keyring string) *Gcloud

func (*Gcloud) Kms

func (g *Gcloud) Kms(operation string) *Gcloud

func (*Gcloud) Plaintext

func (g *Gcloud) Plaintext(plainText string) *Gcloud

func (*Gcloud) Project

func (g *Gcloud) Project(project string) *Gcloud

func (*Gcloud) With

func (g *Gcloud) With(args ...string) *Gcloud

func (*Gcloud) WithName

func (g *Gcloud) WithName(name string) *Gcloud

func (*Gcloud) Zone

func (g *Gcloud) Zone(zone string) *Gcloud

type Kubectl

type Kubectl struct {
	// contains filtered or unexported fields
}

func (*Kubectl) Apply

func (k *Kubectl) Apply() *Kubectl

func (*Kubectl) ApplyFile

func (k *Kubectl) ApplyFile(path string) *Kubectl

func (*Kubectl) ApplyStdIn

func (k *Kubectl) ApplyStdIn(stdIn string) *Kubectl

func (*Kubectl) Cmd

func (k *Kubectl) Cmd() *Command

func (*Kubectl) Context

func (k *Kubectl) Context(context string) *Kubectl

func (*Kubectl) Create

func (k *Kubectl) Create(typeToCreate string) *Kubectl

func (*Kubectl) CurrentContext

func (k *Kubectl) CurrentContext() *Kubectl

func (*Kubectl) Delete

func (k *Kubectl) Delete(typeToDelete string) *Kubectl

func (*Kubectl) DeleteFile

func (k *Kubectl) DeleteFile(path string) *Kubectl

func (*Kubectl) DeleteStdIn

func (k *Kubectl) DeleteStdIn(stdIn string) *Kubectl

func (*Kubectl) DryRun

func (k *Kubectl) DryRun() *Kubectl

func (*Kubectl) DryRunAndApply

func (k *Kubectl) DryRunAndApply(runner Runner) error

func (*Kubectl) File

func (k *Kubectl) File(file string) *Kubectl

func (*Kubectl) GetServiceIP

func (k *Kubectl) GetServiceIP(namespace, name string, runner Runner) (string, error)

func (*Kubectl) IgnoreNotFound

func (k *Kubectl) IgnoreNotFound() *Kubectl

func (*Kubectl) JsonPatch

func (k *Kubectl) JsonPatch(jsonPatch string) *Kubectl

func (*Kubectl) Namespace

func (k *Kubectl) Namespace(ns string) *Kubectl

func (*Kubectl) OutJsonpath

func (k *Kubectl) OutJsonpath(jsonpath string) *Kubectl

func (*Kubectl) OutYaml

func (k *Kubectl) OutYaml() *Kubectl

func (*Kubectl) Redact

func (k *Kubectl) Redact(unredacted, redacted string) *Kubectl

func (*Kubectl) SwallowErrorLog

func (k *Kubectl) SwallowErrorLog(swallow bool) *Kubectl

func (*Kubectl) UseContext

func (k *Kubectl) UseContext(context string) *Kubectl

func (*Kubectl) With

func (k *Kubectl) With(args ...string) *Kubectl

func (*Kubectl) WithName

func (k *Kubectl) WithName(name string) *Kubectl

func (*Kubectl) WithStdIn

func (k *Kubectl) WithStdIn(stdIn string) *Kubectl

type Minikube

type Minikube struct {
	// contains filtered or unexported fields
}

func (*Minikube) Cmd

func (m *Minikube) Cmd() *Command

func (*Minikube) Cpus

func (m *Minikube) Cpus(cpus int) *Minikube

func (*Minikube) Delete

func (m *Minikube) Delete(runner Runner) error

func (*Minikube) FeatureGates

func (m *Minikube) FeatureGates(featureGates []string) *Minikube

func (*Minikube) IP

func (m *Minikube) IP(runner Runner) (string, error)

func (*Minikube) KubeVersion

func (m *Minikube) KubeVersion(kubeVersion string) *Minikube

func (*Minikube) Memory

func (m *Minikube) Memory(mb int) *Minikube

func (*Minikube) Start

func (m *Minikube) Start(runner Runner) error

func (*Minikube) Status

func (m *Minikube) Status() *Minikube

func (*Minikube) SwallowError

func (m *Minikube) SwallowError() *Minikube

func (*Minikube) VmDriver

func (m *Minikube) VmDriver(vmDriver string) *Minikube

func (*Minikube) With

func (m *Minikube) With(args ...string) *Minikube

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func (*Printer) Print

func (p *Printer) Print(format string, args ...interface{})

func (*Printer) Println

func (p *Printer) Println(format string, args ...interface{})

type Reporter

type Reporter interface {
	Print(format string, args ...interface{})
	Println(format string, args ...interface{})
}

func Stderr

func Stderr() Reporter

func Stdout

func Stdout() Reporter

type Runner

type Runner interface {
	Run(c *Command) error
	Output(c *Command) (string, error)
	Stream(c *Command) (*CommandStreamHandler, error)
	Request(req *http.Request) (string, int, error)
	Kill(process *os.Process) error
}

func DefaultCommandRunner

func DefaultCommandRunner() Runner

Directories

Path Synopsis
Package mock_cmd is a generated GoMock package.
Package mock_cmd is a generated GoMock package.

Jump to

Keyboard shortcuts

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