Categorygithub.com/binzume/cfs
repository
0.2.0
Repository: https://github.com/binzume/cfs.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Deprecated

fs.FS in the Go standard library is recommended.

Only the following packages in this library implement the fs.FS interface.

Simple FileSystem abstraction layer library for Go

Build Status codecov GoDoc license

  • Consistent API for multiple backends.
  • Easy to implement backends.
  • FUSE support (Windows/Linux)
  • TODO: fs.FS interface

Backend

  • local storage
  • memory
  • zip (Readonly)
  • http (Readonly)

Usage

local

vol := volume.NewLocalVolume("/var/contents")

// equiv: r, err := os.Open("/var/contents/hello.txt")
r, err := vol.Open("hello.txt")

group

vol := volume.NewVolumeGroup()
vol.AddVolume("aaa", volume.NewLocalVolume("/var/contents_a"))
vol.AddVolume("bbb/data", volume.NewLocalVolume("/var/contents_b"))

// equiv: r, err := os.Open("/var/contents_a/hello.txt")
r, err := vol.Open("aaa/hello.txt")

// equiv: r, err := os.Open("/var/contents_b/index.html")
r, err := vol.Open("bbb/data/index.html")

http

vol := httpvolume.NewHTTPVolume("", false)
r, err := vol.Open("https://example.com/hoge.txt")