kubo/mfs
Lucas Molas 7d531c00ac unixfs: add a directory interface
Add a UnixFS `Directory` that hides implementation details and helps to
distinguish *what* is a UnixFS directory.

Replace the `unixfs.io.Directory` structure that contained the HAMT and basic
directory implementations (through inner pointers) with an interface containing
the same methods. Implement those methods in two clearly distinct structures for
each implementation (`BasicDirectory` and `HAMTDirectory`) avoiding pointer
logic and clearly differentiating which implementation does what.

The potential basic to HAMT transition was being hidden behind the `AddChild`
call at the UnixFS layer (changing one implementation pointer  with the other
one), it is now being explicitly done at the MFS layer.

Rename the `dirbuilder.go` file to `directory.go` and change the `Directory` MFS
attribute `dirbuilder` to `unixfsDir` to be consistent.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-09 12:02:22 -03:00
..
dir.go unixfs: add a directory interface 2018-07-09 12:02:22 -03:00
fd.go merkledag: switch to new dag interface 2018-01-25 15:13:19 -08:00
file.go gx update 2018-06-26 17:11:33 -07:00
mfs_test.go gx update 2018-06-26 17:11:33 -07:00
ops.go gx update go-log, sys, go-crypto 2018-06-08 22:36:24 -07:00
repub_test.go gx update 2018-06-26 17:11:33 -07:00
system.go gx update 2018-06-26 17:11:33 -07:00