retry

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandDoer

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

func Command

func Command(cmd string, args ...string) CommandDoer

func (CommandDoer) Do

func (c CommandDoer) Do(ctx context.Context) error

func (CommandDoer) DoWithErrorHandling

func (c CommandDoer) DoWithErrorHandling(ctx context.Context, errorFunc ErrorFunc) error

DoWithErrorHandling executes the command and runs errorFunc passing a resulting err, stdout and stderr to be handled by the caller. The errorFunc is going to be called only when the resulting err != nil.

func (CommandDoer) WithStderr

func (c CommandDoer) WithStderr(w io.Writer) CommandDoer

func (CommandDoer) WithStdin

func (c CommandDoer) WithStdin(r io.Reader) CommandDoer

func (CommandDoer) WithStdout

func (c CommandDoer) WithStdout(w io.Writer) CommandDoer

type Doer

type Doer interface {
	Do(ctx context.Context) error
	DoWithErrorHandling(ctx context.Context, errorFunc ErrorFunc) error
}

type ErrorFunc

type ErrorFunc func(error, *bytes.Buffer, *bytes.Buffer) error

Jump to

Keyboard shortcuts

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