Documentation
¶
Index ¶
- func ParseHostKey(line string) (gossh.PublicKey, error)
- func ParsePrivateKey(data []byte) (gossh.Signer, error)
- type Config
- type Transport
- func (t *Transport) Close() error
- func (t *Transport) ProbePath(ctx context.Context, path string) (transport.PathState, error)
- func (t *Transport) Put(ctx context.Context, req transport.PutRequest) error
- func (t *Transport) Run(ctx context.Context, req transport.RunRequest) (transport.RunResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseHostKey ¶
ParseHostKey parses a pinned OpenSSH public host key line, e.g. "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... some comment".
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) ProbePath ¶
ProbePath implements transport.Transport. Absence is PROVEN, never guessed from a status code: the walk starts at "/" — the one anchor that must exist on any Linux target — and descends component by component. At every step, all previously traversed prefixes have been positively stat-verified as directories, so when a later component reports SSH_FX_NO_SUCH_FILE, ENOTDIR is impossible: servers (OpenSSH included) map both ENOENT and ENOTDIR onto that one status, and the walk is what removes the ambiguity. A missing component is therefore proven absence of everything beneath it — including a deployRoot that does not exist yet, which is a legitimate fresh-target fact, not an error. A non-directory where a directory is required, a permission failure, any other protocol code, and transport failures are errors — "cannot establish" is never mapped to absence.
The walk trusts that each stat sees a stable namespace for its duration; an external actor rewriting an already-verified parent mid-walk is outside v0.1's threat model (the toolkit serializes its own operations, and SFTP offers no openat-style atomic walk to do better without disguising an assumption as atomicity).
func (*Transport) Put ¶
Put stages req.Content atomically at req.Path via a dedicated SFTP session. The session is owned by this call: the subsystem request, the SFTP handshake and the transfer all run on one worker goroutine, so a single session.Close() on context cancellation unblocks the worker at any stage — including while the handshake is still waiting for the server's version packet. Closing the session leaves the shared SSH connection usable for later operations.