Documentation
¶
Overview ¶
Package main is a runnable end-to-end demonstration of go-sftpsync: it previews a directory transfer, then performs it, and prints both reports.
It runs against an in-process pkg/sftp server over a net.Pipe, so there is no host to reach, no credential to supply and nothing to clean up outside a temp directory. The "remote" side is an ordinary directory that the server serves; everything the library does to it — MkdirAll, SSH_FXP_SETSTAT, posix-rename, SSH_FXP_SYMLINK — goes over the real protocol.
Run from the repo root:
go run ./examples/preview
Expected output (temp paths and duration vary):
plan: upload /tmp/.../app -> /tmp/.../deployed (dry run): 4 files, 3 dirs, 1 symlinks, 96 bytes in 0s dir . 0755 file README 0644 24 B dir bin 0755 file bin/start.sh 0755 29 B dir config 0755 symlink config/current.yaml -> settings.yaml file config/production.yaml 0644 20 B file config/settings.yaml 0644 23 B nothing was written yet; the destination does not exist done: upload /tmp/.../app -> /tmp/.../deployed: 4 files, 3 dirs, 1 symlinks, 96 bytes in 2ms deployed bin/start.sh with mode -rwxr-xr-x
Click to show internal directories.
Click to hide internal directories.