sh

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gosh

func Gosh(vs *VirtualSystem, script string)

Gosh executes a script provided in the argument. If no arguments are provided, it will execute in interactive mode if standard input supports it. This function manages errors and exits appropriately.

func NewRunner

func NewRunner(vs *VirtualSystem, opts ...interp.RunnerOption) (*interp.Runner, error)

func VirtualExecHandler

func VirtualExecHandler(vs *VirtualSystem) func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc

func VirtualOpenHandler

func VirtualOpenHandler(ws vfs.Workspace) interp.OpenHandlerFunc

func VirtualReadDirHandler2

func VirtualReadDirHandler2(ws vfs.Workspace) interp.ReadDirHandlerFunc2

func VirtualStatHandler

func VirtualStatHandler(ws vfs.Workspace) interp.StatHandlerFunc

Types

type ExecHandler added in v0.0.3

type ExecHandler func(context.Context, []string) (bool, error)

func NewDummyExecHandler added in v0.0.3

func NewDummyExecHandler(ioe *IOE) ExecHandler

type IOE added in v0.0.2

type IOE struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

standard IO

type VirtualSystem

type VirtualSystem struct {
	IOE *IOE

	Workspace vfs.Workspace
	System    vos.System

	ExecHandler ExecHandler

	MaxTimeout int
}

func NewLocalSystem

func NewLocalSystem(root string, ioe *IOE) *VirtualSystem

func NewVirtualSystem

func NewVirtualSystem(s vos.System, ws vfs.Workspace, ioe *IOE) *VirtualSystem

func (*VirtualSystem) Run added in v0.0.3

func (s *VirtualSystem) Run(script string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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