cli

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitOnErrorWithMessage

func ExitOnErrorWithMessage(exitcode exitcode.Enum, msg string) error

ExitOnErrorWithMessage informs cli to exit with message and error code

func ExitOnInvalidArgument

func ExitOnInvalidArgument(msg string) error

ExitOnInvalidArgument ...

func ExitOnInvalidOption

func ExitOnInvalidOption(msg string) error

ExitOnInvalidOption ...

func ExitOnNotFound

func ExitOnNotFound(msg string) error

ExitOnNotFound ...

func ExitOnRPC

func ExitOnRPC(msg string) error

ExitOnRPC ...

func FailureResponse

func FailureResponse(err error) error

FailureResponse ...

func SuccessResponse

func SuccessResponse(result interface{}) error

SuccessResponse ...

func UserConfirmed

func UserConfirmed(msg string) bool

UserConfirmed asks user to confirm

Types

type PipeBridge

type PipeBridge interface {
	Printer
	Reader() io.ReadCloser
}

PipeBridge ...

type PipeBridgeController

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

PipeBridgeController is the controller of the bridges of pipe

func NewPipeBridgeController

func NewPipeBridgeController(bridges ...PipeBridge) (*PipeBridgeController, fail.Error)

NewPipeBridgeController creates a new controller of bridges of pipe

func (*PipeBridgeController) Start

func (pbc *PipeBridgeController) Start(ctx context.Context) fail.Error

Start initiates the capture of pipe outputs and the display of what is captured

func (*PipeBridgeController) Stop

func (pbc *PipeBridgeController) Stop() fail.Error

Stop the captures and the display.

func (*PipeBridgeController) Wait

func (pbc *PipeBridgeController) Wait() fail.Error

Wait waits the end of the goroutines

type Printer

type Printer interface {
	Print(interface{})
}

Printer ...

type StderrBridge

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

StderrBridge is a OutputPipe outputting on stderr

func NewStderrBridge

func NewStderrBridge(pipe io.ReadCloser) (*StderrBridge, fail.Error)

NewStderrBridge creates a pipe displaying on stderr

func (*StderrBridge) Print

func (errp *StderrBridge) Print(data interface{})

Print outputs the string to stderr

func (StderrBridge) Reader

func (cb StderrBridge) Reader() io.ReadCloser

type StdoutBridge

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

StdoutBridge is a PipeBridge outputting on stdout

func NewStdoutBridge

func NewStdoutBridge(pipe io.ReadCloser) (*StdoutBridge, fail.Error)

NewStdoutBridge creates an PipeBridge from a bufio.ReadCloser

func (*StdoutBridge) Print

func (outp *StdoutBridge) Print(data interface{})

Print outputs the string to stdout

func (StdoutBridge) Reader

func (cb StdoutBridge) Reader() io.ReadCloser

Directories

Path Synopsis
enums

Jump to

Keyboard shortcuts

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