31 lines
512 B
Go
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
|
|
}
|