1- vfs for golang [ ![ Build Status] ( https://travis-ci.org/blang/vfs.svg?branch=master )] ( https://travis-ci.org/blang/vfs ) [ ![ GoDoc] ( https://godoc.org/github.com/3JoB/vfs?status.png )] ( https://godoc.org/github.com/3JoB/vfs ) [ ![ Coverage Status] ( https://img.shields.io/coveralls/blang/vfs.svg )] ( https://coveralls.io/r/blang/vfs?branch=master ) [ ![ Join the chat at https://gitter.im/blang/vfs ] ( https://badges.gitter.im/Join%20Chat.svg )] ( https://gitter.im/blang/vfs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge )
2- ======
1+ # VFS for GoLang
32
4- vfs is library to support virtual filesystems. It provides basic abstractions of filesystems and implementations, like ` OS ` accessing the file system of the underlying OS and ` memfs ` a full filesystem in-memory.
3+ ![ Build] ( https://github.com/lordofscripts/vfs/actions/workflows/go.yml/badge.svg )
4+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/lordofscripts/vfs?style=flat-square )] ( https://goreportcard.com/report/github.com/lordofscripts/vfs )
5+ [ ![ Coverage] ( https://coveralls.io/repos/github/lordofscripts/vfs/badge.svg?branch=main )] ( https://coveralls.io/github/lordofscripts/vfs?branch=main )
6+ ![ GitHub go.mod Go version] ( https://img.shields.io/github/go-mod/go-version/lordofscripts/vfs )
7+
8+ ` vfs ` is GO library to support * Virtual Filesystems* . It provides the basic
9+ abstractions of filesystems and implementations, like:
10+
11+ * ` OS ` accessing the file system of the underlying OS,
12+ * ` memfs ` a full filesystem in-memory, and
13+ * ` dummy ` which does nothing other than outputting what file operation was
14+ called without actually modifiying the underlying file system.
15+
16+ ## What's Different?
17+
18+ You may have noticed this is a * forked* repository. I forked it from
19+ [ 3JoB/vfs] ( https://github.com/3JoB/vfs ) which in turn is an improved fork of
20+ the original ` blang/vfs ` by [ Benedikt Lang)] ( https://github.com/blang/vfs ) .
21+
22+ I originally used BLang's version ` v1.0.0 ` and was satisfied with it, although I had
23+ to write some extra code to accomplish what I needed. I realized I needed
24+ BLang's ** Dummy** File System but improved to meet my requirements. Unfortunately,
25+ after submitting several issues to the original repository, no answer came of
26+ it. In fact Benedikt's repository has not been updated in 9 years! But it is
27+ still quite useful in its simplicity!
28+
29+ After testing my own shell object to emulate a Dummy Filesystem, I realized it
30+ was better to simply enhance his original ` DummyFS ` . That's how I came across
31+ ** 3JoB's** clone tagged ` v1.0.0 ` which has some enhancements over Benedikt's version:
32+
33+ * Support for Symbolic Links
34+ * Minor changes like using ` any ` instead of ` interface{} `
35+
36+ Therefore, I decided to build upon this one instead. After all, 3JoB's version
37+ was updated last year (2023).
38+
39+ Is this a YAUF (Yet-Another-Useless-Fork)? well, no! I plan on making certain
40+ enhancements that would make it suitable for my application out-of-the-box
41+ without the need for glue structures. So, Keep tuned! But to start with:
42+
43+ * Updated it to use ` main ` as branch instead of the deprecated ` master `
44+ * Added ` go.mod `
45+ * Included a GO workflow.
46+
47+ ## Usage
548
6- Usage
7- -----
849``` bash
9- $ go get github.com/3JoB /vfs
50+ $ go get github.com/lordofscripts /vfs
1051```
1152Note: Always vendor your dependencies or fix on a specific version tag.
1253
1354``` go
14- import github.com /3JoB /vfs
55+ import github.com /lordofscripts /vfs
1556```
1657
1758``` go
@@ -54,8 +95,7 @@ fs.Mkdir("/tmp/testdir", 0777)
5495
5596Check detailed examples below. Also check the [ GoDocs] ( http://godoc.org/github.com/3JoB/vfs ) .
5697
57- Why should I use this lib?
58- -----
98+ ## Why should I use this lib?
5999
60100- Only Stdlib
61101- (Nearly) Fully tested (Coverage >90%)
@@ -64,33 +104,35 @@ Why should I use this lib?
64104- Compose/Wrap Filesystems ` ReadOnly(OS()) ` and write simple Wrappers
65105- Many features, see [ GoDocs] ( http://godoc.org/github.com/3JoB/vfs ) and examples below
66106
67- Features and Examples
68- -----
107+ ## Features and Examples
69108
70109- [ OS Filesystem support] ( http://godoc.org/github.com/3JoB/vfs#example-OsFS )
71110- [ ReadOnly Wrapper] ( http://godoc.org/github.com/3JoB/vfs#example-RoFS )
72111- [ DummyFS for quick mocking] ( http://godoc.org/github.com/3JoB/vfs#example-DummyFS )
73112- [ MemFS - full in-memory filesystem] ( http://godoc.org/github.com/3JoB/vfs/memfs#example-MemFS )
74113- [ MountFS - support mounts across filesystems] ( http://godoc.org/github.com/3JoB/vfs/mountfs#example-MountFS )
75114
76- Current state: ALPHA
77- -----
115+ ### Current state: BETA
78116
79- While the functionality is quite stable and heavily tested, interfaces are subject to change.
117+ While the functionality is quite stable and heavily tested, interfaces are subject to change.
80118
81119 You need more/less abstraction? Let me know by creating a Issue, thank you.
82120
83- Motivation
84- -----
121+ ### Motivation
122+
123+ The original author [ Benedikt Lang] ( https://github.com/blang ) wrote:
124+
125+ > I simply couldn't find any lib supporting this wide range of variation and adaptability.
126+
127+ And I (* LordOfScripts* ) share his thoughts. In fact, I evaluated several similar
128+ GO libraries but many were too bloated and included other appendages I was not
129+ interested in. I loved this VFS version because it had no other dependencies.
85130
86- I simply couldn't find any lib supporting this wide range of variation and adaptability.
87131
88- Contribution
89- -----
132+ ### Contribution
90133
91134Feel free to make a pull request. For bigger changes create a issue first to discuss about it.
92135
93- License
94- -----
136+ ### License
95137
96138See [ LICENSE] ( LICENSE ) file.
0 commit comments