runner

package
v0.6.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsShell added in v0.5.0

func IsShell(block *document.CodeBlock) bool

func IsSupported added in v0.2.4

func IsSupported(lang string) bool

func NewRunnerService added in v0.6.0

func NewRunnerService(logger *zap.Logger) runnerv1.RunnerServiceServer

func NewRunnerServiceHandler added in v0.6.0

func NewRunnerServiceHandler(logger *zap.Logger) runnerv1connect.RunnerServiceHandler

func PrepareScriptFromCommands added in v0.6.0

func PrepareScriptFromCommands(cmds []string) string

Types

type Base

type Base struct {
	Name    string
	Dir     string
	Session *Session
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

type Executable

type Executable interface {
	DryRun(context.Context, io.Writer)
	Run(context.Context) error
}

type Go

type Go struct {
	*Base
	Source string
}

func (*Go) DryRun

func (g *Go) DryRun(ctx context.Context, w io.Writer)

func (*Go) Run

func (g *Go) Run(ctx context.Context) error

type Session added in v0.6.0

type Session struct {
	ID       string
	Metadata map[string]string
	// contains filtered or unexported fields
}

Session is an abstract entity separate from an execution. Currently, its main role is to keep track of environment variables.

func NewSession added in v0.6.0

func NewSession(envs []string, logger *zap.Logger) *Session

func (*Session) AddEnvs added in v0.6.0

func (s *Session) AddEnvs(envs []string)

func (*Session) Envs added in v0.6.0

func (s *Session) Envs() []string

type Shell

type Shell struct {
	*Base
	Cmds []string
}

func (*Shell) DryRun

func (s *Shell) DryRun(ctx context.Context, w io.Writer)

func (*Shell) Run

func (s *Shell) Run(ctx context.Context) error

type ShellRaw added in v0.3.0

type ShellRaw struct {
	*Base
	Cmds []string
}

func (*ShellRaw) DryRun added in v0.3.0

func (s *ShellRaw) DryRun(ctx context.Context, w io.Writer)

func (*ShellRaw) Run added in v0.3.0

func (s *ShellRaw) Run(ctx context.Context) error

type ShellSession added in v0.6.0

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

func NewShellSession added in v0.6.0

func NewShellSession(command string) (*ShellSession, error)

func (*ShellSession) Close added in v0.6.0

func (s *ShellSession) Close() error

func (*ShellSession) Done added in v0.6.0

func (s *ShellSession) Done() <-chan struct{}

func (*ShellSession) Err added in v0.6.0

func (s *ShellSession) Err() error

func (*ShellSession) ID added in v0.6.0

func (s *ShellSession) ID() string

func (*ShellSession) Send added in v0.6.0

func (s *ShellSession) Send(data []byte) error

Jump to

Keyboard shortcuts

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