A pure-go dependency free memory filesystem (memfs) that abstracts a file system ontop of go datatypes and allows developers to interact through an API modeled after the Go File standard library.
Development plans include mounting the memory file system so it is accessible and visible from terminal and provide easy hooking of functionality on write/read and other operations for further layers of abstraction.
package main
import(
"fmt"
"os"
"github.com/multiverse-os/memfs"
)
func main() {
fs, err := memfs.NewFS()
if err != nil {
panic(err)
}
// Opens a file with read/write permissions in the current directory
f, _ := fs.Create("/example.txt")
f.Write([]byte("Hello, world!"))
f.Close()
fs.Remove("example.txt")
}