copytool

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend string
const (
	BackendAuto  Backend = "auto"
	BackendRsync Backend = "rsync"
	BackendSCP   Backend = "scp"
)

type CopyTool

type CopyTool interface {
	// Name returns the name of the copy tool.
	Name() string
	// Command builds and returns the exec.Cmd for the copy operation. If opts is set, it is used for this invocation instead of the tool's Options set during initialization, without modifying the stored Options.
	Command(ctx context.Context, paths []string, opts *Options) (*exec.Cmd, error)
	// IsAvailableOnGuest checks if the tool is available on the specified guest instance.
	IsAvailableOnGuest(ctx context.Context, paths []string) bool
}

CopyTool is the interface for copy tool implementations.

func New

func New(ctx context.Context, backend string, paths []string, opts *Options) (CopyTool, error)

New creates a new CopyTool based on the specified backend.

type Options

type Options struct {
	Recursive      bool
	Verbose        bool
	AdditionalArgs []string // Make sure that the additional args are valid for a specific tool and escaped before passing them here.
}

Options contains common options for copy operations. This might not be a complete list; more options can be added as needed.

type Path

type Path struct {
	InstanceName string
	Path         string
	IsRemote     bool
	Instance     *limatype.Instance
}

Jump to

Keyboard shortcuts

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