helper

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package helper implements Courier's temporary, consent-gated remote helper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeSFTP

func ServeSFTP(input io.Reader, output io.Writer) error

ServeSFTP serves the established SFTP protocol over process standard streams.

Types

type Acquire

type Acquire func(context.Context, sshx.Platform) (*Artifact, error)

Acquire obtains an exact-platform helper without touching the remote host.

type Artifact

type Artifact struct {
	Path    string
	SHA256  string
	Cleanup func() error
}

Artifact is one locally verified helper executable.

type Confirm

type Confirm func(context.Context, string) (bool, error)

Confirm asks for explicit consent before helper acquisition or deployment.

type Deploy

Deploy stages and starts a helper over an authenticated SSH connection.

type Detect

Detect identifies the authenticated remote platform without changing it.

type Manager

type Manager struct {
	Confirm Confirm
	Acquire Acquire
	Deploy  Deploy
	Detect  Detect
	// contains filtered or unexported fields
}

Manager applies the capability, consent, acquisition, and cleanup policy.

func (*Manager) Fallback

func (m *Manager) Fallback(ctx context.Context, connection *sshx.Connection, capability *sshx.CapabilityError) (*sftp.Client, io.Closer, error)

Fallback satisfies sshx.Factory.SFTPFallback.

type Source

type Source struct {
	Repository string
	Version    string
	Token      string
	Client     update.HTTPClient
	GOOS       string
	GOARCH     string
	Executable func() (string, error)
	EvalLinks  func(string) (string, error)
}

Source selects the running executable for matching platforms and immutable GitHub Release artifacts for cross-platform helpers.

func (Source) Acquire

func (s Source) Acquire(ctx context.Context, platform sshx.Platform) (*Artifact, error)

Acquire returns a verified helper for platform.

Jump to

Keyboard shortcuts

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