Documentation
¶
Overview ¶
Package local executes commands and transfers files on the machine the program is running on. It is the reference invoke.Environment: every behavior it implements is pinned by the invoketest contract suite.
Windows is not a supported execution target this cycle; the package compiles there, but New returns an error wrapping invoke.ErrNotSupported.
Index ¶
- type Environment
- func (e *Environment) Capabilities() invoke.Capabilities
- func (e *Environment) Close() error
- func (e *Environment) Download(ctx context.Context, remotePath, localPath string, ...) error
- func (e *Environment) LookPath(ctx context.Context, name string) (string, error)
- func (e *Environment) OS() invoke.TargetOS
- func (e *Environment) Start(ctx context.Context, cmd invoke.Command, stdio invoke.IO) (invoke.Process, error)
- func (e *Environment) Upload(ctx context.Context, localPath, remotePath string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment runs commands on the local machine.
func (*Environment) Capabilities ¶
func (e *Environment) Capabilities() invoke.Capabilities
Capabilities reports the local target's optional features: signal delivery and symlink-preserving transfers work; TTY allocation is not implemented this cycle.
func (*Environment) Close ¶
func (e *Environment) Close() error
Close marks the environment closed and terminates any processes still running. It is idempotent.
func (*Environment) Download ¶
func (e *Environment) Download(ctx context.Context, remotePath, localPath string, opts ...invoke.TransferOption) error
Download copies a file or directory tree between local paths, with the same semantics as Upload.
func (*Environment) OS ¶
func (e *Environment) OS() invoke.TargetOS
OS reports the local operating system.
func (*Environment) Start ¶
func (e *Environment) Start(ctx context.Context, cmd invoke.Command, stdio invoke.IO) (invoke.Process, error)
Start launches cmd on the local machine.
func (*Environment) Upload ¶
func (e *Environment) Upload(ctx context.Context, localPath, remotePath string, opts ...invoke.TransferOption) error
Upload copies a file or directory tree between local paths. On this provider Upload and Download are the same operation; both exist so the Environment contract holds regardless of target.