Skip to content

binzume/cfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages