{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package integration\n\n## Functions\n\n```go\nfunc CompareDirectoryEntries(e1 []os.FileInfo, e2 []os.FileInfo) error\n```\nCompareDirectoryEntries compares two sets of FileInfo (usually taken from a directory) and returns an error if different.\n\n```go\nfunc ConsumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, stop chan bool) (n int, err error)\n```\nConsumeWithSpeed reads chunkSize bytes from reader before sleeping for interval duration. Returns total read bytes. Send true to the stop channel to return before reading to EOF on the reader.\n\n```go\nfunc ConvertSliceOfStringsToMap(input []string) map[string]struct{}\n```\nConvertSliceOfStringsToMap converts a slices of string in a map with the strings as key and an empty string as values.\n\n```go\nfunc DockerCmd(dockerBinary string, c *check.C, args ...string) (string, int)\n```\nDockerCmd executes a docker command and returns the output and the exit code. If the command returns an error, it will fail and stop the tests.\n\n```go\nfunc DockerCmdInDir(dockerBinary string, path string, args ...string) (string, int, error)\n```\nDockerCmdInDir executes a docker command in a directory and returns the output, the exit code and the error (if any).\n\n```go\nfunc DockerCmdInDirWithTimeout(dockerBinary string, timeout time.Duration, path string, args ...string) (string, int, error)\n```\nDockerCmdInDirWithTimeout executes a docker command in a directory with a timeout and returns the output, the exit code and the error (if any).\n\n```go\nfunc DockerCmdWithError(dockerBinary string, args ...string) (string, int, error)\n```\nDockerCmdWithError executes a docker command that is supposed to fail and returns the output, the exit code and the error.\n\n```go\nfunc DockerCmdWithStdoutStderr(dockerBinary string, c *check.C, args ...string) (string, string, int)\n```\nDockerCmdWithStdoutStderr executes a docker command and returns the content of the stdout, stderr and the exit code. If a check.C is passed, it will fail and stop tests if the error is not nil.\n\n```go\nfunc DockerCmdWithTimeout(dockerBinary string, timeout time.Duration, args ...string) (string, int, error)\n```\nDockerCmdWithTimeout executes a docker command with a timeout, and returns the output, the exit code and the error (if any).\n\n```go\nfunc GetExitCode(err error) (int, error)\n```\nGetExitCode returns the ExitStatus of the specified error if its type is exec.ExitError, returns 0 and an error otherwise.\n\n```go\nfunc IsKilled(err error) bool\n```\nIsKilled process the specified error and returns whether the process was killed or not.\n\n```go\nfunc ListTar(f io.Reader) ([]string, error)\n```\nListTar lists the entries of a tar.\n\n```go\nfunc ParseCgroupPaths(procCgroupData string) map[string]string\n```\nParseCgroupPaths parses 'procCgroupData', which is output of '/proc/\\\u003cpid\u003e/cgroup', and returns a map which cgroup name as key and path as value.\n\n```go\nfunc ProcessExitCode(err error) (exitCode int)\n```\nProcessExitCode process the specified error and returns the exit status code if the error was of type exec.ExitError, returns nothing otherwise.\n\n```go\nfunc RandomTmpDirPath(s string, platform string) string\n```\nRandomTmpDirPath provides a temporary path with rand string appended. does not create or checks if it exists.\n\n```go\nfunc RunAtDifferentDate(date time.Time, block func())\n```\nRunAtDifferentDate runs the specified function with the given time. It changes the date of the system, which can led to weird behaviors.\n\n```go\nfunc RunCommand(cmd *exec.Cmd) (exitCode int, err error)\n```\nRunCommand runs the specified command and returns the exitCode different from 0 and the error if something bad happened.\n\n```go\nfunc RunCommandPipelineWithOutput(cmds ...*exec.Cmd) (output string, exitCode int, err error)\n```\nRunCommandPipelineWithOutput runs the array of commands with the output of each pipelined with the following (like cmd1 | cmd2 | cmd3 would do). It returns the final output, the exitCode different from 0 and the error if something bad happened.\n\n```go\nfunc RunCommandWithOutput(cmd *exec.Cmd) (output string, exitCode int, err error)\n```\nRunCommandWithOutput runs the specified command and returns the combined output (stdout/stderr) with the exitCode different from 0 and the error if something bad happened\n\n```go\nfunc RunCommandWithOutputAndTimeout(cmd *exec.Cmd, timeout time.Duration) (output string, exitCode int, err error)\n```\nRunCommandWithOutputAndTimeout runs the specified command \"timeboxed\" by the specified duration. It returns the output with the exitCode different from 0 and the error if something bad happened or if the process timed out (and has been killed).\n\n```go\nfunc RunCommandWithOutputForDuration(cmd *exec.Cmd, duration time.Duration) (output string, exitCode int, timedOut bool, err error)\n```\nRunCommandWithOutputForDuration runs the specified command \"timeboxed\" by the specified duration. If the process is still running when the timebox is finished, the process will be killed and . It will returns the output with the exitCode different from 0 and the error if something bad happened and a boolean whether it has been killed or not.\n\n```go\nfunc RunCommandWithStdoutStderr(cmd *exec.Cmd) (stdout string, stderr string, exitCode int, err error)\n```\nRunCommandWithStdoutStderr runs the specified command and returns stdout and stderr separately with the exitCode different from 0 and the error if something bad happened\n\n```go\nfunc UnmarshalJSON(data []byte, result interface{}) error\n```\nUnmarshalJSON deserialize a JSON in the given interface.\n\n## Types\n\n```go\ntype ChannelBuffer struct {\n\tC chan []byte\n}\n```\nChannelBuffer holds a chan of byte array that can be populate in a goroutine.\n\n```go\nfunc (c *ChannelBuffer) Close() error\n```\nClose closes the go channel.\n\n```go\nfunc (c *ChannelBuffer) ReadTimeout(p []byte, n time.Duration) (int, error)\n```\nReadTimeout reads the content of the channel in the specified byte array with the specified duration as timeout.\n\n```go\nfunc (c *ChannelBuffer) Write(b []byte) (int, error)\n```\nWrite implements Writer.\n\n","path":"github.com/hyperhq/hypercli/pkg/integration","name":"integration","synopsis":"","isRedistributable":true}
