Commit Graph

17 Commits

Author SHA1 Message Date
John Eikenberry e1c86753b9 OS specific syscall.Stat_t use into separate file
The use of Stat_t in request-example.go is unix specific and broke the
Windows OS builds. This is the minimal change to fix that.

This fixes #157.
2017-02-24 20:06:51 -08:00
John Eikenberry 5d2bc88197 use modtime field instead of time.Now() 2017-02-18 18:20:37 -08:00
John Eikenberry ce4586e8a5 convert request to be pass by value
Encapsulate stateful data into sub-structures with pointer references
from the Request structure. This allows me to pass by value in most
cases to keep non-stateful (write once) data data race free and tightly
controlling access to stateful data to ease locking.
2017-02-18 18:20:37 -08:00
John Eikenberry 8cd6e6229d add lock to file access 2017-02-18 18:20:37 -08:00
John Eikenberry 94ae9c6822 fix issue with out-of-order packets 2017-02-18 18:20:37 -08:00
John Eikenberry 99921c4e1d add delay to writes based on length
To mimic write delays server side and introduce ordering errors.
2017-02-18 18:20:37 -08:00
John Eikenberry f18f3a1b48 govet fixes 2017-02-18 18:20:37 -08:00
John Eikenberry 9962211713 linter fixes 2017-02-18 18:20:37 -08:00
John Eikenberry 4974c76d49 remove some debug prints 2017-02-18 18:20:37 -08:00
John Eikenberry b387807529 Revert "have Stat() mimic os.Stat()'s error"
did this to make sure client received file not found error. changed
things so previous os.ErrNotExist works.
2017-02-18 18:20:37 -08:00
John Eikenberry d2ddc0b86f error if file rename target already exists 2017-02-18 18:20:37 -08:00
John Eikenberry 95dbe811f7 have Stat() mimic os.Stat()'s error 2017-02-18 18:20:37 -08:00
John Eikenberry e355d86d50 reordered and commented to improve as example 2017-02-18 18:20:37 -08:00
John Eikenberry 138f292b1b add symlink support to file mode info 2017-02-18 18:20:37 -08:00
John Eikenberry 584416ecbc FileInfo.Sys() returns a point to syscall.Stat_t
Returning the file stat struct with uid/gid set allows 'ls -l' to work
in sftp.
2017-02-18 18:20:37 -08:00
John Eikenberry 3f229eeee3 switch fs from tree to flat map
Simplify the example handlers FS-like struct by changing it from a tree
to a map.
2017-02-18 18:20:37 -08:00
John Eikenberry b7df6d6ef6 initial version of in-memory example/test request backend 2017-02-18 18:20:37 -08:00