Documentation
¶
Overview ¶
Package sshexec implements the MCP execution ports using the shared SSH/SFTP core. It does not load inventory, secrets, trust, or defaults from CLI state.
Index ¶
- func OpenClientPTY(ctx context.Context, client *ssh.Client, release func() error) (ports.PTYSession, error)
- func RunDedicatedForward(ctx context.Context, client *ssh.Client, spec tunnel.Spec, ...) (retErr error)
- type Backend
- func (b *Backend) Inspect(ctx context.Context, permit ports.Permit, nodeID string, ...) (_ remotefile.Metadata, retErr error)
- func (b *Backend) OpenFiles(ctx context.Context, permit ports.Permit, nodeID string) (ports.FileSession, error)
- func (b *Backend) OpenPTY(ctx context.Context, permit ports.Permit, nodeID string) (ports.PTYSession, error)
- func (b *Backend) OpenTransfer(ctx context.Context, permit ports.Permit, nodeID string) (ports.TransferSession, error)
- func (b *Backend) ProbeExecution(ctx context.Context, permit ports.Permit, nodeID string) (_ *ssh.ProbeResult, retErr error)
- func (b *Backend) Retire(plan ssh.ConnectionPlan) error
- func (b *Backend) RetirePlans(ctx context.Context, plans []ssh.ConnectionPlan) error
- func (b *Backend) Run(ctx context.Context, permit ports.Permit, nodeID string, command ports.Command) (result ports.CommandResult, retErr error)
- func (b *Backend) RunTunnel(ctx context.Context, permit ports.Permit, spec tunnel.Spec, ...) (retErr error)
- func (b *Backend) Shutdown(ctx context.Context) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenClientPTY ¶ added in v0.16.0
func OpenClientPTY(ctx context.Context, client *ssh.Client, release func() error) (ports.PTYSession, error)
OpenClientPTY opens a persistent PTY-backed shell session on client. Ownership of release is transferred to the returned PTYSession on success, or invoked immediately if setup fails.
func RunDedicatedForward ¶
func RunDedicatedForward(ctx context.Context, client *ssh.Client, spec tunnel.Spec, ready func(string) bool, report func(error)) (retErr error)
RunDedicatedForward requires an exclusively owned SSH/ProxyJump transport. Wait interrupts that physical transport on cancellation; this must never be called with an ordinary command/transfer pool's borrowed client.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) OpenTransfer ¶
func (*Backend) ProbeExecution ¶
func (*Backend) Retire ¶
func (b *Backend) Retire(plan ssh.ConnectionPlan) error
Retire drains a cached plan but never grants or revokes execution permission.
func (*Backend) RetirePlans ¶
RetirePlans is a publication callback. Old admitted operations can still finish, but late connections for their retired snapshots are not cached.