1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-23 18:24:13 +00:00
Beego/fs.go

31 lines
576 B
Go
Raw Normal View History

package beego
import (
"net/http"
"os"
"path/filepath"
)
type IFileSystem interface {
http.FileSystem
Walk(string, filepath.WalkFunc) error
}
// A File is returned by a FileSystem's Open method and can be
// served by the FileServer implementation.
//
// The methods should behave the same as those on an *os.File.
type File struct {
*os.File
}
type FileSystem struct {
}
func (d FileSystem) Open(name string) (http.File, error) {
return os.Open(name)
}
func (d FileSystem) Walk(root string, walkFn filepath.WalkFunc) error {
return filepath.Walk(root, walkFn)
}