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