mirror of
https://github.com/astaxie/beego.git
synced 2025-02-16 23:27:05 +00:00
31 lines
576 B
Go
31 lines
576 B
Go
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)
|
|
}
|