client

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRunnerClientUnimplemented = fmt.Errorf("method unimplemented")

Functions

func ApplyOptions

func ApplyOptions(rc Runner, opts ...RunnerOption) error

Types

type LocalRunner

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

func NewLocalRunner

func NewLocalRunner(opts ...RunnerOption) (*LocalRunner, error)

func (*LocalRunner) Cleanup

func (r *LocalRunner) Cleanup(ctx context.Context) error

func (*LocalRunner) DryRunBlock

func (r *LocalRunner) DryRunBlock(ctx context.Context, block *document.CodeBlock, w io.Writer, opts ...RunnerOption) error

func (*LocalRunner) RunBlock

func (r *LocalRunner) RunBlock(ctx context.Context, block *document.CodeBlock) error

type RemoteRunner

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

func NewRemoteRunner

func NewRemoteRunner(ctx context.Context, addr string, opts ...RunnerOption) (*RemoteRunner, error)

func (*RemoteRunner) Cleanup

func (r *RemoteRunner) Cleanup(ctx context.Context) error

func (*RemoteRunner) DryRunBlock

func (r *RemoteRunner) DryRunBlock(ctx context.Context, block *document.CodeBlock, w io.Writer, opts ...RunnerOption) error

func (*RemoteRunner) RunBlock

func (r *RemoteRunner) RunBlock(ctx context.Context, block *document.CodeBlock) error

type Runner

type Runner interface {
	RunBlock(ctx context.Context, block *document.CodeBlock) error
	DryRunBlock(ctx context.Context, block *document.CodeBlock, w io.Writer, opts ...RunnerOption) error
	Cleanup(ctx context.Context) error
	// contains filtered or unexported methods
}

type RunnerOption

type RunnerOption func(Runner) error

func WithDir

func WithDir(dir string) RunnerOption

func WithLogger

func WithLogger(logger *zap.Logger) RunnerOption

func WithSession

func WithSession(s *runner.Session) RunnerOption

func WithStderr

func WithStderr(stderr io.Writer) RunnerOption

func WithStdin

func WithStdin(stdin io.Reader) RunnerOption

func WithStdout

func WithStdout(stdout io.Writer) RunnerOption

func WithinShellMaybe

func WithinShellMaybe() RunnerOption

Jump to

Keyboard shortcuts

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