-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional interfaces for Symlink and Readlink #228
Conversation
ok, got sidetracked with some family things and then assigned to a different project, but I've had a chance to come back to this. I made use of this branch to make a wrapper for compatibility with https://github.com/src-d/go-git. Go-git is used in an application we have which otherwise uses afero for other operations. After writing the wrapper we wrote a full test that sequestially tested the core git operations one after another, including its use of symlink and readLink. other than some issues with the tests themselves, this appears to work without issue on windows, ubuntu and an alpine based docker container (I don't have access to a darwin system to test). I do have some stylistic questions prior to requesting a final merge howerver: |
@Maldris consistency with the os package is nice to have. |
In that case, are there any changes (functional or stylistic) you would advise before this can be merged? If not, I'll rebase the branch against master and it should be good to go. |
@Maldris your changes lgtm, please rebase and I'll merge. |
union interface supportint lstat, symlink and readlink
ok, clean rebase pushed, and the builds still pass. |
Can we get a release for this? I would really love to use this feature <3 |
I created two interfaces to facilitate file systems optionally supporting the Symlink and Readlink operations from the os implementation.
I opted to write them this way to preserve consistency with the Lstater interface created by @bep
The actual Symlink and Readlink are only implemented in the
OsFs
, with proxy support in:for consistency with the other two I implemented the Linker interface on
ReadOnlyFs
with it just returning a not supported error. I would appreciate feedback if this is the correct pattern, or if I should instead remove the method?The motivation for this change was to allow wrapping an existing use of afero in a project with the go-billy interface to allow a git integration to support a client request.
The implementation is in the process of being tested in our logic, but I wanted to create the pull request and get feedback and make any necessary changes early.