client

package
v3.6.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 30 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

func ConvertToRunnerProject

func ConvertToRunnerProject(proj *project.Project) *runnerv1.Project

func NewPrefixWriter

func NewPrefixWriter(w io.Writer, prefix string) io.Writer

func ResolveDirectory

func ResolveDirectory(parentDir string, task project.Task) string

func WithTempSettings

func WithTempSettings(rc Runner, opts []RunnerOption, cb func() error) error

Types

type LocalRunner

type LocalRunner struct {
	*RunnerSettings
	// 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) Clone

func (r *LocalRunner) Clone() Runner

func (*LocalRunner) DryRunTask

func (r *LocalRunner) DryRunTask(ctx context.Context, task project.Task, w io.Writer, opts ...RunnerOption) error

func (*LocalRunner) GetEnvs

func (r *LocalRunner) GetEnvs(ctx context.Context) ([]string, error)

func (*LocalRunner) ResolveProgram added in v3.3.0

func (*LocalRunner) RunTask

func (r *LocalRunner) RunTask(ctx context.Context, task project.Task) error

type MultiRunner

type MultiRunner struct {
	Runner Runner

	StdoutPrefix string

	PreRunMsg  func(tasks []project.Task, parallel bool) string
	PostRunMsg func(task project.Task, exitCode uint) string

	PreRunOpts []RunnerOption
}

func (MultiRunner) Cleanup

func (m MultiRunner) Cleanup(ctx context.Context) error

func (MultiRunner) RunBlocks

func (m MultiRunner) RunBlocks(ctx context.Context, tasks []project.Task, parallel bool) error

type RemoteRunner

type RemoteRunner struct {
	*RunnerSettings
	// 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) Clone

func (r *RemoteRunner) Clone() Runner

func (*RemoteRunner) DryRunTask

func (r *RemoteRunner) DryRunTask(ctx context.Context, task project.Task, w io.Writer, opts ...RunnerOption) error

func (*RemoteRunner) GetEnvs

func (r *RemoteRunner) GetEnvs(ctx context.Context) ([]string, error)

func (*RemoteRunner) GetSessionID added in v3.2.3

func (r *RemoteRunner) GetSessionID() string

func (*RemoteRunner) ResolveProgram added in v3.3.0

func (*RemoteRunner) RunTask

func (r *RemoteRunner) RunTask(ctx context.Context, task project.Task) error

type Runner

type Runner interface {
	RunTask(ctx context.Context, task project.Task) error
	DryRunTask(ctx context.Context, task project.Task, w io.Writer, opts ...RunnerOption) error
	Cleanup(ctx context.Context) error

	Clone() Runner

	GetEnvs(ctx context.Context) ([]string, error)

	ResolveProgram(ctx context.Context, mode runnerv1.ResolveProgramRequest_Mode, script string, language string) (*runnerv1.ResolveProgramResponse, error)
	// contains filtered or unexported methods
}

func New added in v3.3.4

func New(context context.Context, serverAddr string, fallbackRunner bool, runnerOpts []RunnerOption) (Runner, error)

type RunnerOption

type RunnerOption func(Runner) error

func WithCleanupSession

func WithCleanupSession(cleanup bool) RunnerOption

func WithCustomShell

func WithCustomShell(customShell string) RunnerOption

func WithDir

func WithDir(dir string) RunnerOption

func WithEnableBackgroundProcesses

func WithEnableBackgroundProcesses(enableBackground bool) RunnerOption

func WithEnvStoreType added in v3.2.3

func WithEnvStoreType(EnvStoreType runnerv1.SessionEnvStoreType) RunnerOption

func WithEnvs

func WithEnvs(envs []string) RunnerOption

func WithInsecure

func WithInsecure(insecure bool) RunnerOption

func WithLogger

func WithLogger(logger *zap.Logger) RunnerOption

func WithProject

func WithProject(proj *project.Project) RunnerOption

func WithSession

func WithSession(s *runner.Session) RunnerOption

func WithSessionID

func WithSessionID(id string) RunnerOption

func WithSessionStrategy

func WithSessionStrategy(strategy runnerv1.SessionStrategy) RunnerOption

func WithStderr

func WithStderr(stderr io.Writer) RunnerOption

func WithStderrTransform

func WithStderrTransform(op func(io.Writer) io.Writer) RunnerOption

func WithStdin

func WithStdin(stdin io.Reader) RunnerOption

func WithStdinTransform

func WithStdinTransform(op func(io.Reader) (io.Reader, error)) RunnerOption

func WithStdout

func WithStdout(stdout io.Writer) RunnerOption

func WithStdoutTransform

func WithStdoutTransform(op func(io.Writer) io.Writer) RunnerOption

func WithTLSDir

func WithTLSDir(tlsDir string) RunnerOption

func WithinShellMaybe

func WithinShellMaybe() RunnerOption

func WrapWithCancelReader

func WrapWithCancelReader() RunnerOption

type RunnerSettings

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

func (*RunnerSettings) Clone

func (rs *RunnerSettings) Clone() *RunnerSettings

Jump to

Keyboard shortcuts

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