go-billy icon indicating copy to clipboard operation
go-billy copied to clipboard

Use spf13/afero or provide a compatibility layer?

Open purpleidea opened this issue 6 years ago • 4 comments

I use https://github.com/spf13/afero/ in a number of ways. I wanted to use https://github.com/src-d/go-git/ with that as the backing filesystem. As a result, I'd have to either switch to this, or implement a compatibility layer. Since the former is not possible, I think the later might be a good approach.

I'm opening this issue to track that progress. Basically we should have a helper function which takes a fileystem from afero and returns something that implements this interface. That should probably be in the afero lib, and the opposite should be here.

purpleidea avatar Nov 17 '18 23:11 purpleidea

@purpleidea I recommend implementing a billy.Filesystem on top of an afero one. We are open for PRs

mcuadros avatar Dec 10 '18 22:12 mcuadros

FWIW I implemented this Afero compatibility for go-vfs with go-vfsafero using exactly the idea that @purpleidea describes here.

twpayne avatar Dec 18 '18 00:12 twpayne

I've started a go-billy fs that uses afero as a backend. Still needs documentation but you should be able to wrap it with:

billyfs := desfacer.New(aferofs)

https://github.com/jfontan/go-billy-desfacer

jfontan avatar Dec 18 '18 20:12 jfontan

+1

grzesiek avatar Jul 22 '19 10:07 grzesiek