runner

package
v0.6.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxMsgSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func IsShell added in v0.5.0

func IsShell(lang string) 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 Executable

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

type ExecutableConfig added in v0.6.0

type ExecutableConfig struct {
	Name    string
	Dir     string
	Tty     bool
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
	Session *Session
	Logger  *zap.Logger
}

type Go

type Go struct {
	*ExecutableConfig
	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 {
	*ExecutableConfig
	Cmds []string
}

func (Shell) DryRun

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

func (Shell) ProgramPath added in v0.6.0

func (s Shell) ProgramPath() string

func (Shell) Run

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

type ShellRaw added in v0.3.0

type ShellRaw struct {
	*Shell
}

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