neutered-filesystem/neutered-filesystem.go
2021-12-24 01:17:44 +00:00

31 lines
512 B
Go

package neutered_filesystem
import (
"net/http"
"os"
)
type NeuteredFileSystem struct {
fs http.FileSystem
}
func New(fs http.FileSystem) NeuteredFileSystem {
return NeuteredFileSystem{fs}
}
func (fs NeuteredFileSystem) Open(name string) (http.File, error) {
f, err := fs.fs.Open(name)
if err != nil {
return nil, err
}
return neuteredReaddirFile{f}, nil
}
type neuteredReaddirFile struct {
http.File
}
func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) {
return nil, nil
}