Documentation
¶
Index ¶
- func New(adapters interfaces.Adapter, conf ...map[string]interface{}) interfaces.Fllesystem
- type Directory
- type File
- func (file *File) Copy(newpath string) (*File, bool)
- func (file *File) Delete() bool
- func (file *File) Exists() bool
- func (file *File) GetMetadata() map[string]interface{}
- func (file *File) GetMimetype() string
- func (file *File) GetSize() int64
- func (file *File) GetTimestamp() int64
- func (file *File) GetVisibility() string
- func (file *File) Put(content string) bool
- func (file *File) PutStream(resource *os.File) bool
- func (file *File) Read() interface{}
- func (file *File) ReadStream() *os.File
- func (file *File) Rename(newpath string) bool
- func (file *File) SetFilesystem(filesystem interfaces.Fllesystem) *File
- func (file *File) SetPath(path string) *File
- func (file *File) Update(content string) bool
- func (file *File) UpdateStream(resource *os.File) bool
- func (file *File) Write(content string) bool
- func (file *File) WriteStream(resource *os.File) bool
- type Fllesystem
- func (fs *Fllesystem) Copy(path string, newpath string) bool
- func (fs *Fllesystem) CreateDir(dirname string, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) Delete(path string) bool
- func (fs *Fllesystem) DeleteDir(dirname string) bool
- func (fs *Fllesystem) Get(path string, handler ...func(interfaces.Fllesystem, string) interface{}) interface{}
- func (fs *Fllesystem) GetAdapter() interfaces.Adapter
- func (fs *Fllesystem) GetConfig() interfaces.Config
- func (fs *Fllesystem) GetFllesystem() interfaces.Fllesystem
- func (fs *Fllesystem) GetMetadata(path string) map[string]interface{}
- func (fs *Fllesystem) GetMimetype(path string) string
- func (fs *Fllesystem) GetSize(path string) int64
- func (fs *Fllesystem) GetTimestamp(path string) int64
- func (fs *Fllesystem) GetVisibility(path string) string
- func (fs *Fllesystem) Has(path string) bool
- func (fs *Fllesystem) ListContents(dirname string, recursive ...bool) []map[string]interface{}
- func (fs *Fllesystem) PrepareConfig(settings map[string]interface{}) interfaces.Config
- func (fs *Fllesystem) Put(path string, contents string, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) PutStream(path string, resource *os.File, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) Read(path string) interface{}
- func (fs *Fllesystem) ReadAndDelete(path string) (interface{}, error)
- func (fs *Fllesystem) ReadStream(path string) *os.File
- func (fs *Fllesystem) Rename(path string, newpath string) bool
- func (fs *Fllesystem) SetConfig(conf interfaces.Config)
- func (fs *Fllesystem) SetVisibility(path string, visibility string) bool
- func (fs *Fllesystem) Update(path string, contents string, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) UpdateStream(path string, resource *os.File, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) WithAdapter(adapters interfaces.Adapter) interfaces.Fllesystem
- func (fs *Fllesystem) Write(path string, contents string, conf ...map[string]interface{}) bool
- func (fs *Fllesystem) WriteStream(path string, resource *os.File, conf ...map[string]interface{}) bool
- type Handler
- func (hand *Handler) GetFilesystem() interfaces.Fllesystem
- func (hand *Handler) GetPath() string
- func (hand *Handler) GetType() string
- func (hand *Handler) IsDir() bool
- func (hand *Handler) IsFile() bool
- func (hand *Handler) SetFilesystem(filesystem interfaces.Fllesystem) interface{}
- func (hand *Handler) SetPath(path string) interface{}
- type MountManager
- func (mm *MountManager) Copy(from string, to string, conf ...map[string]interface{}) bool
- func (mm *MountManager) CreateDir(dirname string, conf ...map[string]interface{}) bool
- func (mm *MountManager) Delete(path string) bool
- func (mm *MountManager) DeleteDir(dirname string) bool
- func (mm *MountManager) FilterPrefix(arguments []string) (string, []string)
- func (mm *MountManager) Get(path string, handler ...func(interfaces.Fllesystem, string) interface{}) interface{}
- func (mm *MountManager) GetFilesystem(prefix string) interfaces.Fllesystem
- func (mm *MountManager) GetMetadata(path string) map[string]interface{}
- func (mm *MountManager) GetMimetype(path string) string
- func (mm *MountManager) GetPrefixAndPath(path string) (string, string)
- func (mm *MountManager) GetSize(path string) int64
- func (mm *MountManager) GetTimestamp(path string) int64
- func (mm *MountManager) GetVisibility(path string) string
- func (mm *MountManager) Has(path string) bool
- func (mm *MountManager) ListContents(directory string, recursive ...bool) []map[string]interface{}
- func (mm *MountManager) MountFilesystem(prefix string, filesystem interfaces.Fllesystem) *MountManager
- func (mm *MountManager) MountFilesystems(filesystems map[string]interface{}) *MountManager
- func (mm *MountManager) Move(from string, to string, conf ...map[string]interface{}) bool
- func (mm *MountManager) Put(path string, contents string, conf ...map[string]interface{}) bool
- func (mm *MountManager) PutStream(path string, resource *os.File, conf ...map[string]interface{}) bool
- func (mm *MountManager) Read(path string) interface{}
- func (mm *MountManager) ReadAndDelete(path string) (interface{}, error)
- func (mm *MountManager) ReadStream(path string) *os.File
- func (mm *MountManager) Rename(path string, newpath string) bool
- func (mm *MountManager) SetVisibility(path string, visibility string) bool
- func (mm *MountManager) Update(path string, contents string, conf ...map[string]interface{}) bool
- func (mm *MountManager) UpdateStream(path string, resource *os.File, conf ...map[string]interface{}) bool
- func (mm *MountManager) Write(path string, contents string, conf ...map[string]interface{}) bool
- func (mm *MountManager) WriteStream(path string, resource *os.File, conf ...map[string]interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(adapters interfaces.Adapter, conf ...map[string]interface{}) interfaces.Fllesystem
new 文件管理器
Types ¶
type Directory ¶
type Directory struct {
Handler
}
*
- 文件管理器文件夹操作扩展 *
- @create 2021-8-1
- @author deatil
func NewDirectory ¶
func NewDirectory(filesystem interfaces.Fllesystem, path ...string) *Directory
new 文件管理器
func (*Directory) GetContents ¶
列出文件
func (*Directory) SetFilesystem ¶
func (dir *Directory) SetFilesystem(filesystem interfaces.Fllesystem) *Directory
设置管理器
type File ¶
type File struct {
Handler
}
*
- 文件管理扩展 *
- @create 2021-8-1
- @author deatil
func (*File) SetFilesystem ¶
func (file *File) SetFilesystem(filesystem interfaces.Fllesystem) *File
设置管理器
type Fllesystem ¶
type Fllesystem struct {
// contains filtered or unexported fields
}
*
- 文件管理器 *
- @create 2021-8-1
- @author deatil
func (*Fllesystem) CreateDir ¶
func (fs *Fllesystem) CreateDir(dirname string, conf ...map[string]interface{}) bool
创建文件夹
func (*Fllesystem) Get ¶
func (fs *Fllesystem) Get(path string, handler ...func(interfaces.Fllesystem, string) interface{}) interface{}
获取 Get("file.txt").(*fllesystem.File).Read() Get("/file").(*fllesystem.Directory).Read()
func (*Fllesystem) GetFllesystem ¶
func (fs *Fllesystem) GetFllesystem() interfaces.Fllesystem
获取文件系统
func (*Fllesystem) GetMetadata ¶
func (fs *Fllesystem) GetMetadata(path string) map[string]interface{}
信息数据
func (*Fllesystem) ListContents ¶
func (fs *Fllesystem) ListContents(dirname string, recursive ...bool) []map[string]interface{}
列表
func (*Fllesystem) PrepareConfig ¶
func (fs *Fllesystem) PrepareConfig(settings map[string]interface{}) interfaces.Config
提前设置配置
func (*Fllesystem) Put ¶
func (fs *Fllesystem) Put(path string, contents string, conf ...map[string]interface{}) bool
更新
func (*Fllesystem) PutStream ¶
func (fs *Fllesystem) PutStream(path string, resource *os.File, conf ...map[string]interface{}) bool
更新数据流
func (*Fllesystem) ReadAndDelete ¶
func (fs *Fllesystem) ReadAndDelete(path string) (interface{}, error)
读取并删除
func (*Fllesystem) SetVisibility ¶
func (fs *Fllesystem) SetVisibility(path string, visibility string) bool
设置权限
func (*Fllesystem) Update ¶
func (fs *Fllesystem) Update(path string, contents string, conf ...map[string]interface{}) bool
更新字符
func (*Fllesystem) UpdateStream ¶
func (fs *Fllesystem) UpdateStream(path string, resource *os.File, conf ...map[string]interface{}) bool
更新数据流
func (*Fllesystem) WithAdapter ¶
func (fs *Fllesystem) WithAdapter(adapters interfaces.Adapter) interfaces.Fllesystem
设置适配器
func (*Fllesystem) Write ¶
func (fs *Fllesystem) Write(path string, contents string, conf ...map[string]interface{}) bool
写入文件
func (*Fllesystem) WriteStream ¶
func (fs *Fllesystem) WriteStream(path string, resource *os.File, conf ...map[string]interface{}) bool
写入数据流
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
*
- 扩展基础类 *
- @create 2021-8-1
- @author deatil
func (*Handler) SetFilesystem ¶
func (hand *Handler) SetFilesystem(filesystem interfaces.Fllesystem) interface{}
设置文件系统
type MountManager ¶
type MountManager struct {
// contains filtered or unexported fields
}
*
- 文件系统 *
- @create 2021-8-7
- @author deatil
func NewMountManager ¶
func NewMountManager(filesystems ...map[string]interface{}) *MountManager
文件系统实例化
func (*MountManager) Copy ¶
func (mm *MountManager) Copy(from string, to string, conf ...map[string]interface{}) bool
复制
func (*MountManager) CreateDir ¶
func (mm *MountManager) CreateDir(dirname string, conf ...map[string]interface{}) bool
创建文件夹
func (*MountManager) FilterPrefix ¶
func (mm *MountManager) FilterPrefix(arguments []string) (string, []string)
过滤 [:prefix, :arguments]
func (*MountManager) Get ¶
func (mm *MountManager) Get(path string, handler ...func(interfaces.Fllesystem, string) interface{}) interface{}
获取 Get("file.txt").(*fllesystem.File).Read() Get("/file").(*fllesystem.Directory).Read()
func (*MountManager) GetFilesystem ¶
func (mm *MountManager) GetFilesystem(prefix string) interfaces.Fllesystem
获取文件管理器
func (*MountManager) GetMetadata ¶
func (mm *MountManager) GetMetadata(path string) map[string]interface{}
信息数据
func (*MountManager) GetPrefixAndPath ¶
func (mm *MountManager) GetPrefixAndPath(path string) (string, string)
获取前缀和路径 [:prefix, :path]
func (*MountManager) ListContents ¶
func (mm *MountManager) ListContents(directory string, recursive ...bool) []map[string]interface{}
列出内容
func (*MountManager) MountFilesystem ¶
func (mm *MountManager) MountFilesystem(prefix string, filesystem interfaces.Fllesystem) *MountManager
单独
func (*MountManager) MountFilesystems ¶
func (mm *MountManager) MountFilesystems(filesystems map[string]interface{}) *MountManager
批量
func (*MountManager) Move ¶
func (mm *MountManager) Move(from string, to string, conf ...map[string]interface{}) bool
移动
func (*MountManager) Put ¶
func (mm *MountManager) Put(path string, contents string, conf ...map[string]interface{}) bool
更新
func (*MountManager) PutStream ¶
func (mm *MountManager) PutStream(path string, resource *os.File, conf ...map[string]interface{}) bool
更新数据流
func (*MountManager) ReadAndDelete ¶
func (mm *MountManager) ReadAndDelete(path string) (interface{}, error)
读取并删除
func (*MountManager) SetVisibility ¶
func (mm *MountManager) SetVisibility(path string, visibility string) bool
设置权限
func (*MountManager) Update ¶
func (mm *MountManager) Update(path string, contents string, conf ...map[string]interface{}) bool
更新字符
func (*MountManager) UpdateStream ¶
func (mm *MountManager) UpdateStream(path string, resource *os.File, conf ...map[string]interface{}) bool
更新数据流
func (*MountManager) Write ¶
func (mm *MountManager) Write(path string, contents string, conf ...map[string]interface{}) bool
写入文件
func (*MountManager) WriteStream ¶
func (mm *MountManager) WriteStream(path string, resource *os.File, conf ...map[string]interface{}) bool
写入数据流
Click to show internal directories.
Click to hide internal directories.