local

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 15 Imported by: 0

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

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 New

func New() (*Environment, error)

New returns an Environment for 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) LookPath

func (e *Environment) LookPath(ctx context.Context, name string) (string, error)

LookPath resolves name against the host process's PATH.

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.

Jump to

Keyboard shortcuts

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