workerprovision

package
v0.209.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DryRunCommand

func DryRunCommand(target string, args []string) string

DryRunCommand returns a redacted human-readable command for diagnostics.

func ParsePlatform

func ParsePlatform(s string) (string, string, error)

Types

type Executor

type Executor interface {
	Run(ctx context.Context, args []string, stdin io.Reader) (string, error)
	Copy(ctx context.Context, source, destination string) error
}

Executor is the small seam around the system ssh/scp (or wsl.exe) commands. Implementations must never put secrets in argv; stdin is used for credentials.

type Options

type Options struct {
	ID         string
	Server     string
	Token      string
	Binary     string
	BinaryURL  string
	RemotePath string
	DryRun     bool
	Timeout    time.Duration
	Executor   Executor
	Output     io.Writer
	// ResolveURL / ResolveBinary let callers reuse their configured release mirror.
	// They are called only after the remote platform has been probed.
	ResolveURL    func(context.Context, string, string) (string, error)
	ResolveBinary func(context.Context, string, string) (string, error)
}

Options describes one remote worker installation.

type Result

type Result struct {
	OS, Arch, RemotePath string
	UsedDownload         bool
}

func Run

func Run(ctx context.Context, o Options) (Result, error)

Run probes, installs, initializes and starts a worker. It stops at the first failed step. The token is sent to worker init over stdin and is never an argv value.

type SystemExecutor

type SystemExecutor struct {
	SSH      string
	WSL      string
	TargetOS string
}

SystemExecutor uses only the operating system's ssh/scp or wsl.exe.

func (SystemExecutor) Copy

func (e SystemExecutor) Copy(ctx context.Context, source, destination string) error

func (SystemExecutor) Run

func (e SystemExecutor) Run(ctx context.Context, args []string, stdin io.Reader) (string, error)

Jump to

Keyboard shortcuts

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