cli

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(executor CommandExecutor, cmd Command) error

func JoinCommandEvents added in v2.2.5

func JoinCommandEvents(left func(cmd *cobra.Command, args []string) error, right func(cmd *cobra.Command, args []string) error, rightBeforeLeft bool) func(cmd *cobra.Command, args []string) error

func NewContextWithSignalListener added in v2.2.10

func NewContextWithSignalListener(ctx context.Context, signalChannel <-chan os.Signal) context.Context

func SignalListener added in v2.2.10

func SignalListener(signals ...os.Signal) <-chan os.Signal

Types

type Command

type Command interface {
	RawCommand() string
	ProcessResults(stdout string, stderr string, exitCode int) error
}

type CommandExecutor

type CommandExecutor interface {
	ExecuteCommand(string) (stdout string, stderr string, err error)
	CheckErrorForExitCode(err error) (int, bool)
}

type UnexpectedResultError

type UnexpectedResultError struct {
	StdOut          string
	StdErr          string
	ExitCode        *int
	UnderlyingError error
}

func (*UnexpectedResultError) Error

func (u *UnexpectedResultError) Error() string

Jump to

Keyboard shortcuts

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