Documentation
¶
Overview ¶
Package mountfs 把多个本地目录组合成一个虚拟文件系统:根目录只读,按挂载名称列出各目录, 每个挂载可单独设为只读。FTP 与 WebDAV 用户挂载多个目录时使用。
Index ¶
- func Afero(mounts []Mount) afero.Fs
- func Validate(mounts []Mount) error
- func WebDAV(mounts []Mount) xwebdav.FileSystem
- type Mount
- type ReadOnlyDAV
- func (ReadOnlyDAV) Mkdir(context.Context, string, os.FileMode) error
- func (r ReadOnlyDAV) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (xwebdav.File, error)
- func (ReadOnlyDAV) RemoveAll(context.Context, string) error
- func (ReadOnlyDAV) Rename(context.Context, string, string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WebDAV ¶
func WebDAV(mounts []Mount) xwebdav.FileSystem
WebDAV 返回由 mounts 组成的 webdav.FileSystem,挂载列表需已通过 Validate。
Types ¶
type Mount ¶
type Mount struct {
// Name 是虚拟根目录下显示的目录名
Name string `json:"name"`
// Path 是本地目录(绝对路径)
Path string `json:"path"`
ReadOnly bool `json:"readOnly"`
}
Mount 是用户可访问的一个目录。
type ReadOnlyDAV ¶
type ReadOnlyDAV struct{ xwebdav.FileSystem }
ReadOnlyDAV 包装 webdav.FileSystem,拒绝所有写操作。
Click to show internal directories.
Click to hide internal directories.