Skip to content

Commit 6c36a20

Browse files
author
Lord of Scripts
committed
Updated module name
1 parent 5d0c56f commit 6c36a20

18 files changed

+116
-44
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to include it)
18+
# vendor/
19+
20+
# Go workspace file
21+
go.work
22+
go.work.sum
23+
24+
# env file
25+
.env
26+
27+
# Others
28+
bin/*
29+
TODO*
30+
*.bfproject

README.md

Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,58 @@
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
```
1152
Note: 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

5596
Check 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

91134
Feel free to make a pull request. For bigger changes create a issue first to discuss about it.
92135

93-
License
94-
-----
136+
### License
95137

96138
See [LICENSE](LICENSE) file.

example_dummy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"os"
77

8-
"github.com/3JoB/vfs"
8+
"github.com/lordofscripts/vfs"
99
)
1010

1111
type myFS struct {

example_os_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package vfs_test
33
import (
44
"fmt"
55

6-
"github.com/3JoB/vfs"
6+
"github.com/lordofscripts/vfs"
77
)
88

99
func ExampleOsFS() {

example_readonly_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/3JoB/vfs"
7+
"github.com/lordofscripts/vfs"
88
)
99

1010
// Every vfs.Filesystem could be easily wrapped

example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"errors"
55
"os"
66

7-
"github.com/3JoB/vfs"
8-
"github.com/3JoB/vfs/memfs"
9-
"github.com/3JoB/vfs/mountfs"
7+
"github.com/lordofscripts/vfs"
8+
"github.com/lordofscripts/vfs/memfs"
9+
"github.com/lordofscripts/vfs/mountfs"
1010
)
1111

1212
func Example() {

example_wrapping_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"os"
77

8-
"github.com/3JoB/vfs"
8+
"github.com/lordofscripts/vfs"
99
)
1010

1111
type noNewDirs struct {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/3JoB/vfs
1+
module github.com/lordofscripts/vfs
22

3-
go 1.20
3+
go 1.22.1

ioutil_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"os"
66
"testing"
77

8-
"github.com/3JoB/vfs"
9-
"github.com/3JoB/vfs/memfs"
8+
"github.com/lordofscripts/vfs"
9+
"github.com/lordofscripts/vfs/memfs"
1010
)
1111

1212
var (

memfs/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package memfs_test
22

33
import (
4-
"github.com/3JoB/vfs/memfs"
4+
"github.com/lordofscripts/vfs/memfs"
55
)
66

77
func ExampleMemFS() {

0 commit comments

Comments
 (0)