utils

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, s string) bool

Helper functions to check and remove string from a slice of strings.

func CopyBufferContentsToFile

func CopyBufferContentsToFile(srcBuff []byte, destFile string) (err error)

func CopyBufferContentsToTempFile

func CopyBufferContentsToTempFile(srcBuff []byte, destFile string) (err error)

Copies source buffer to the tmp directory Insures tmp directory exists and prepends path Temporary, used for writing Kops Manifest to file but exploring using STDIN instead

func Remove

func Remove(slice []string, s string) (result []string)

func RunCmd

func RunCmd(cmdString string) (*bytes.Buffer, error)

func RunDockerCmd

func RunDockerCmd(dockerArgs []string) (*bytes.Buffer, error)

func RunStreamingCmd

func RunStreamingCmd(cmdString string) error

func WriteTempFile

func WriteTempFile(data string, pattern string) (string, error)

Types

type Cmd

type Cmd struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, entry *logrus.Entry, command string, arg ...string) *Cmd

func (*Cmd) GetCmdString

func (c *Cmd) GetCmdString() []string

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) StdoutStderrPipe

func (c *Cmd) StdoutStderrPipe() (*multiCloser, error)

func (*Cmd) Wait

func (c *Cmd) Wait() error

Jump to

Keyboard shortcuts

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