Commit Graph

135 Commits

Author SHA1 Message Date
Jerry Jacobs 90ff561dda Add SftpFs beta backend 2015-12-26 20:36:25 +01:00
Hanno Hecker e7cb826c1f update README to match the filters 2015-12-21 13:34:19 -05:00
Hanno Hecker f4b37b446e Add RegexpFilter
- rework FilterFs to be truely chaining, i.e. every call not intercepted
  must be passed to the source Fs
- AddFilter accepts just a FilterFs, not a Fs
- FilterFs' AddFilter(FilterFs) should be implemented by any
  FilterFs like

  func (f *myFilter) AddFilter(fs FilterFs) {
       fs.SetSource(f.source)
       f.source = fs
  }
2015-12-21 13:34:19 -05:00
Martin Bertschler 98ed0a3409 return improved errors from MemMapFs methods
MemMapFs.Mkdir now returns an error if the file or dir already exists
MemMapFs.Remove now returns an error if the file or dir doesn't exists

fixes #43
2015-12-20 22:09:09 +01:00
Bjørn Erik Pedersen 2101bdf57c Unexport the RWMutex in MemMapFs 2015-12-18 21:26:04 +01:00
Bjørn Erik Pedersen 7e65370ebb Remove unused mutex 2015-12-18 19:49:23 +01:00
Bjørn Erik Pedersen 75b0bd216a Fix data races in MemMapFs
Also simplifiy the lock constructs.

Fixes #44
Fixes #45
2015-12-18 19:20:45 +01:00
Hanno Hecker 36b075cbbf show how filtering is used 2015-12-15 18:18:10 +01:00
Hanno Hecker 03c0cb5702 drop filter_regexp for now, needs some more changes for reading dirs 2015-12-15 18:17:36 +01:00
Hanno Hecker 8c337dcc24 block all write flags instead of checking for O_RDONLY 2015-12-13 18:12:18 +01:00
Hanno Hecker 3b1997ba29 add Fs filter 2015-12-13 14:56:00 +01:00
Martin Bertschler 9d44c3003b add a test for twice calling Create on the same path 2015-12-11 11:02:03 +01:00
Steve Francia 12f79b29b2 Update mem to keep things private 2015-12-10 15:13:36 -05:00
Steve Francia 4b2ab283a0 add debugging method for MemMapFs 2015-12-10 15:13:17 -05:00
Steve Francia 69df1e98f2 Improve testing output 2015-12-10 15:13:17 -05:00
Steve Francia 99f1ddeda3 reposition gitter badge 2015-12-10 13:14:25 -05:00
Steve Francia c42b320414 Merge pull request #38 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-12-10 13:13:25 -05:00
The Gitter Badger fffa47e80f Add Gitter badge 2015-12-10 18:05:16 +00:00
Martin Bertschler 37f7afc8d7 Fix artefacts from moving MemMapFs types into subpackage mem 2015-12-10 18:55:43 +01:00
Steve Francia 99c3e9a2c7 Release 0.10 of Afero 2015-12-10 12:26:46 -05:00
Steve Francia b5982947d7 Clarify naming in readme
fixes #28
2015-12-10 12:26:46 -05:00
Steve Francia 508533e0fc Adding utilities to readme 2015-12-10 12:26:46 -05:00
Steve Francia 965d098e7c Moving memory structures and interfaces into sub package 2015-12-10 12:26:38 -05:00
Martin Bertschler ede672fd82 Merge pull request #36 from moorereason/iss35
Fix closing and deleting of files in tests
2015-12-10 12:18:13 +01:00
Cameron Moore 85a9c733f6 Fix closing and deleting of files in tests
A few things are fixed by this commit:

- check error value returned from `fs.RemoveAll` in `removeAllTestFiles`.
- Defer statements are a LIFO, and were out of order in some test functions.
- The TestReaddir* funcs were failing to close some file handles.
- `findNames` was opening file handles but ignoring them.  Bad.
2015-12-09 23:35:59 -06:00
Martin Bertschler 90b5a9bd18 Fix TestWalk to use the new setup functions and make it Windows ready
I had to wrap the setupTestFiles() function for this test, one for returning the root of the test dir and the other one to reuse the path that was returned from the first function. If this is not done setupTestDir writes into two different folders that are returned from os.TempDir() and the output of the two walk functions can't be compared.
2015-12-09 23:34:42 +01:00
Steve Francia 943d877c43 Fix remaining Windows bugs and tests 2015-12-09 15:37:15 -05:00
Martin Bertschler 9d86e5d5fa Update AppVeyor config to fetch dependencies 2015-12-09 10:05:28 +01:00
Steve Francia daf7a87d8f Make "findParent" work on Windows properly
Fixes #31
2015-12-08 21:48:19 -05:00
Steve Francia e042b5f805 making the fs property accessible Afero.fs -> Afero.Fs 2015-12-08 16:26:39 -05:00
Steve Francia 28bccc4ad0 reorder all utility functions to have fs as 1st param
This is a BREAKING CHANGE to the Walk and ReadDir functions that
existed prior to this branch addition. This change is not done without
considerable thought.

Having FS come first is done for two reasons.
1: It's more idiomatic go
2: It's more logical. It allows the function signature to read easier
and flow from the broadest value to the most narrow.

For example, WriteReader would read..
writeReader on this fs, to this path (on that fs),
with this data (at that path, on that fs).

I believe that when the first two were implemented it wasn't at all
obvious that the order wasn't correct, nevertheless, permitting a
lot of new functions defined in an incorrect or inconsistent order
seems like the worst option.

It was decided that a breaking change today would be best, even if it
was mildly painful at the present.
2015-12-08 16:26:39 -05:00
Steve Francia 90555c1894 reorganize utils into afero package 2015-12-08 16:26:38 -05:00
Steve Francia 3a517135a5 Adding Afero/utils
Portions ported from Go StdLib ioutils
Portions ported from Hugo's helpers
2015-12-08 16:24:09 -05:00
Steve Francia f50d862134 Adding "/" to MemMapFS in a cleaner way 2015-12-08 16:24:09 -05:00
Steve Francia a9385f2db9 Removing extra normalize call
(since open already normalizes)
2015-12-08 16:24:09 -05:00
Steve Francia 54ad8f690d MkdirAll should respect permissions (MemMapFS) 2015-12-08 16:24:09 -05:00
Martin Bertschler adb80c3cf7 Fix AppVeyor badge 2015-12-08 18:08:37 +01:00
Martin Bertschler 708d4bcfd5 Fix walk function in test to not panic if an error is passed 2015-12-06 16:25:06 +01:00
Martin Bertschler 17333d8c34 Integrate AppVeyor config file 2015-12-06 12:29:59 +01:00
Martin Bertschler b705e04d55 Add AppVeyor badge to Readme 2015-12-06 11:56:46 +01:00
Martin Bertschler 55789de153 Format Readme.md code blocks as Go code 2015-12-03 18:23:48 +01:00
Steve Francia 3a224e9827 Normalize Paths so "/boo/" and "/boo" are the same 2015-12-03 09:45:14 -05:00
Steve Francia 75dc847d59 Start MemMapFS with a root directory. 2015-12-02 16:27:14 -05:00
Steve Francia f85f3b3779 reorganize and update readme 2015-12-01 17:10:13 -05:00
Steve Francia 4d968e2d2e Add logo image to readme 2015-11-30 21:04:23 -05:00
Steve Francia 4a72472d2c Update README.md 2015-11-30 20:54:51 -05:00
Martin Bertschler 12fcb8c83d Merge pull request #23 from tpng/patch-1
atomic requires struct field to be 64-bit aligned
2015-11-26 08:07:36 +01:00
Benny Ng 6fafcd5853 atomic requires struct field to be 64-bit aligned
fix https://github.com/spf13/hugo/issues/1621
2015-11-26 13:03:56 +08:00
Martin Bertschler 0ad3406941 Merge pull request #22 from mbertschler/fix-rename
Fix MemMapFs.Rename()
2015-11-22 14:42:06 +01:00
Martin Bertschler 5a59c3f940 properly rename files by changing file.name and newly registering with parent 2015-11-22 14:34:57 +01:00