Go to file
Cassondra Foesch 5e8f9f4960 MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
.github/workflows CI: use Makefile for tests 2021-01-20 13:35:58 +01:00
examples sftp: update tests to finish and not panic on windows 2019-01-18 16:29:07 -08:00
server_standalone server_standalone: handle readonly properly 2017-03-15 12:45:09 -07:00
.gitignore ignore test keys in all examples 2017-06-29 14:48:40 -07:00
CONTRIBUTORS Adding myself as I'm helping out 2017-01-06 17:20:11 -08:00
LICENSE Rename LICENCE to LICENSE 2014-10-27 21:31:41 +00:00
Makefile the allocator can now be enabled per request 2020-03-18 09:36:07 +01:00
README.md update documentation links 2021-01-20 13:52:30 +01:00
allocator.go the allocator can now be enabled per request 2020-03-18 09:36:07 +01:00
allocator_test.go the allocator can now be enabled per request 2020-03-18 09:36:07 +01:00
attrs.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
attrs_stubs.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
attrs_test.go fix lint issues 2019-08-30 17:04:37 +02:00
attrs_unix.go fix lint issues 2019-08-30 17:04:37 +02:00
client.go client statVFS: normalize the returned error 2021-02-10 19:35:30 +01:00
client_integration_darwin_test.go fix lint issues 2019-08-30 17:04:37 +02:00
client_integration_linux_test.go New method Client.Extensions to list server extensions 2020-10-23 11:16:44 +02:00
client_integration_test.go avoid panic if double call to Close 2021-02-22 12:04:43 +00:00
client_test.go Don't crash when the packet length is zero 2020-11-02 17:07:10 +01:00
conn.go don't broadcast anything other than disconnect to clients 2020-11-04 10:02:59 +01:00
debug.go added debug option, build/test with -tags debug to activate 2014-09-28 12:32:34 +10:00
example_test.go Fix example error 2020-06-30 12:01:49 +09:00
fuzz.go Don't crash when the packet length is zero 2020-11-02 17:07:10 +01:00
go.mod update deps 2021-01-20 13:57:40 +01:00
go.sum update deps 2021-01-20 13:57:40 +01:00
match.go Fixes #188; eliminates duplicated core code 2017-07-20 15:28:11 -07:00
packet-manager.go pack structures so they have less size 2020-09-08 10:18:15 +02:00
packet-manager_test.go MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
packet-typing.go fix lint issues 2019-08-30 17:04:37 +02:00
packet.go MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
packet_test.go add optional AllocationModeOptimized 2020-03-14 19:42:19 +01:00
release.go added debug option, build/test with -tags debug to activate 2014-09-28 12:32:34 +10:00
request-attrs.go fix lint issues 2019-08-30 17:04:37 +02:00
request-attrs_test.go Add const for all attribute flags and add missing newline 2019-12-27 10:56:42 +01:00
request-errors.go fix lint issues 2019-08-30 17:04:37 +02:00
request-example.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
request-interfaces.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
request-plan9.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
request-readme.md update Request structure docs for path and flag changes 2018-01-04 13:30:43 -08:00
request-server.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
request-server_test.go remove write/read race condition 2021-02-22 12:04:43 +00:00
request-unix.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
request.go no need to double type switch 2021-02-22 12:04:43 +00:00
request_test.go add optional AllocationModeOptimized 2020-03-14 19:42:19 +01:00
request_windows.go Revert PR #370 2020-08-24 11:22:05 +02:00
server.go MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
server_integration_test.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
server_statvfs_darwin.go add serverside StatVFS function, implemented for darwin and linux (#89) 2016-06-13 14:45:13 +10:00
server_statvfs_impl.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
server_statvfs_linux.go Remove gccgo special cases 2018-02-02 15:01:09 -05:00
server_statvfs_plan9.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
server_statvfs_stubs.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
server_stubs.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
server_test.go MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
server_unix.go added build tags required for gcc-go on AIX 2018-07-26 16:04:57 +05:00
sftp.go request-server: add StatVFS support 2021-02-10 19:13:19 +01:00
sftp_test.go Fix build on Plan 9 2020-09-10 18:18:22 -04:00
stat_plan9.go go fmt 2020-09-17 09:54:29 +00:00
stat_posix.go go fmt 2020-09-17 09:54:29 +00:00
syscall_fixed.go fix S_IFMT value on windows and plan9 2020-01-02 12:59:24 -08:00
syscall_good.go fix S_IFMT value on windows and plan9 2020-01-02 12:59:24 -08:00

README.md

sftp

The sftp package provides support for file system operations on remote ssh servers using the SFTP subsystem. It also implements an SFTP server for serving files from the filesystem.

CI Status Go Reference

usage and examples

See https://pkg.go.dev/github.com/pkg/sftp for examples and usage.

The basic operation of the package mirrors the facilities of the os package.

The Walker interface for directory traversal is heavily inspired by Keith Rarick's fs package.

roadmap

  • There is way too much duplication in the Client methods. If there was an unmarshal(interface{}) method this would reduce a heap of the duplication.

contributing

We welcome pull requests, bug fixes and issue reports.

Before proposing a large change, first please discuss your change by raising an issue.

For API/code bugs, please include a small, self contained code example to reproduce the issue. For pull requests, remember test coverage.

We try to handle issues and pull requests with a 0 open philosophy. That means we will try to address the submission as soon as possible and will work toward a resolution. If progress can no longer be made (eg. unreproducible bug) or stops (eg. unresponsive submitter), we will close the bug.

Thanks.