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 []byte) (bool, error)
- func (this *File) PutStream(resource *os.File) (bool, error)
- func (this *File) Read() ([]byte, error)
- func (this *File) ReadStream() (*os.File, error)
- func (this *File) Rename(newpath string) (bool, error)
- func (this *File) Update(content []byte) (bool, error)
- func (this *File) UpdateStream(resource io.Reader) (bool, error)
- func (this *File) WithFilesystem(filesystem *Filesystem) *File
- func (this *File) WithPath(path string) *File
- func (this *File) Write(content []byte) (bool, error)
- func (this *File) WriteStream(resource io.Reader) (bool, error)
- type Filesystem
- func (this *Filesystem) Append(path string, contents []byte, conf ...map[string]any) (bool, error)
- func (this *Filesystem) AppendStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
- func (this *Filesystem) Copy(path string, newpath string) (bool, error)
- func (this *Filesystem) CreateDir(dirname string, conf ...map[string]any) (bool, error)
- func (this *Filesystem) Delete(path string) (bool, error)
- func (this *Filesystem) DeleteDir(dirname string) (bool, error)
- func (this *Filesystem) Get(path string, handler ...func(*Filesystem, string) any) any
- func (this *Filesystem) GetAdapter() interfaces.Adapter
- func (this *Filesystem) GetConfig() interfaces.Config
- func (this *Filesystem) GetMetadata(path string) (map[string]any, error)
- func (this *Filesystem) GetMimetype(path string) (string, error)
- func (this *Filesystem) GetSize(path string) (int64, error)
- func (this *Filesystem) GetTimestamp(path string) (int64, error)
- func (this *Filesystem) GetVisibility(path string) (string, error)
- func (this *Filesystem) Has(path string) bool
- func (this *Filesystem) ListContents(dirname string, recursive ...bool) ([]map[string]any, error)
- func (this *Filesystem) PrepareConfig(settings map[string]any) interfaces.Config
- func (this *Filesystem) Prepend(path string, contents []byte, conf ...map[string]any) (bool, error)
- func (this *Filesystem) PrependStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
- func (this *Filesystem) Put(path string, contents []byte, conf ...map[string]any) (bool, error)
- func (this *Filesystem) PutStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
- func (this *Filesystem) Read(path string) ([]byte, error)
- func (this *Filesystem) ReadAndDelete(path string) ([]byte, error)
- func (this *Filesystem) ReadStream(path string) (*os.File, error)
- func (this *Filesystem) Rename(path string, newpath string) (bool, error)
- func (this *Filesystem) SetVisibility(path string, visibility string) (bool, error)
- func (this *Filesystem) Update(path string, contents []byte, conf ...map[string]any) (bool, error)
- func (this *Filesystem) UpdateStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
- func (this *Filesystem) WithAdapter(adapters interfaces.Adapter) *Filesystem
- func (this *Filesystem) WithConfig(conf interfaces.Config)
- func (this *Filesystem) Write(path string, contents []byte, conf ...map[string]any) (bool, error)
- func (this *Filesystem) WriteStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
- type Handler
- func (this *Handler) GetFilesystem() *Filesystem
- 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 *Filesystem) 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(*Filesystem, string) any) any
- func (this *MountManager) GetFilesystem(prefix string) *Filesystem
- 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 *Filesystem) *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 []byte, 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) ([]byte, 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 []byte, 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 []byte, 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) WithFilesystem ¶ added in v1.0.1007
func (this *Directory) WithFilesystem(filesystem *Filesystem) *Directory
设置管理器
type File ¶
type File struct {
Handler
}
*
- 文件管理扩展 *
- @create 2021-8-1
- @author deatil
func (*File) WithFilesystem ¶ added in v1.0.1007
func (this *File) WithFilesystem(filesystem *Filesystem) *File
设置管理器
type Filesystem ¶ added in v1.0.1007
type Filesystem struct {
// contains filtered or unexported fields
}
*
- 文件管理器
- Filesystem struct *
- @create 2021-8-1
- @author deatil
func New ¶
func New(adapter interfaces.Adapter, conf ...map[string]any) *Filesystem
文件管理器 return a *Filesystem
func (*Filesystem) AppendStream ¶ added in v1.0.1007
func (this *Filesystem) AppendStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
尾部添加数据流 Append resource Stream
func (*Filesystem) Copy ¶ added in v1.0.1007
func (this *Filesystem) Copy(path string, newpath string) (bool, error)
复制 Copy path
func (*Filesystem) Delete ¶ added in v1.0.1007
func (this *Filesystem) Delete(path string) (bool, error)
删除 Delete path
func (*Filesystem) DeleteDir ¶ added in v1.0.1007
func (this *Filesystem) DeleteDir(dirname string) (bool, error)
删除文件夹 Delete Dir
func (*Filesystem) Get ¶ added in v1.0.1007
func (this *Filesystem) Get(path string, handler ...func(*Filesystem, string) any) any
获取 Get file := Get("/file.txt").(*File) dir := Get("/dir").(*Directory)
func (*Filesystem) GetAdapter ¶ added in v1.0.1007
func (this *Filesystem) GetAdapter() interfaces.Adapter
获取适配器 Get Adapter
func (*Filesystem) GetConfig ¶ added in v1.0.1007
func (this *Filesystem) GetConfig() interfaces.Config
获取配置 Get Config
func (*Filesystem) GetMetadata ¶ added in v1.0.1007
func (this *Filesystem) GetMetadata(path string) (map[string]any, error)
信息数据 Get Metadata
func (*Filesystem) GetMimetype ¶ added in v1.0.1007
func (this *Filesystem) GetMimetype(path string) (string, error)
类型 GetMimetype
func (*Filesystem) GetSize ¶ added in v1.0.1007
func (this *Filesystem) GetSize(path string) (int64, error)
大小 GetSize
func (*Filesystem) GetTimestamp ¶ added in v1.0.1007
func (this *Filesystem) GetTimestamp(path string) (int64, error)
时间戳 GetTimestamp
func (*Filesystem) GetVisibility ¶ added in v1.0.1007
func (this *Filesystem) GetVisibility(path string) (string, error)
权限 GetVisibility string
func (*Filesystem) Has ¶ added in v1.0.1007
func (this *Filesystem) Has(path string) bool
判断 return true if path exists, else false
func (*Filesystem) ListContents ¶ added in v1.0.1007
列表 ListContents
func (*Filesystem) PrepareConfig ¶ added in v1.0.1007
func (this *Filesystem) PrepareConfig(settings map[string]any) interfaces.Config
提前设置配置 Prepare Config
func (*Filesystem) PrependStream ¶ added in v1.0.1007
func (this *Filesystem) PrependStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
文件头添加数据流 Prepend resource Stream
func (*Filesystem) PutStream ¶ added in v1.0.1007
func (this *Filesystem) PutStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
更新数据流 Put stream resource to path
func (*Filesystem) Read ¶ added in v1.0.1007
func (this *Filesystem) Read(path string) ([]byte, error)
文件到字符 Read bytes
func (*Filesystem) ReadAndDelete ¶ added in v1.0.1007
func (this *Filesystem) ReadAndDelete(path string) ([]byte, error)
读取并删除 read and delete
func (*Filesystem) ReadStream ¶ added in v1.0.1007
func (this *Filesystem) ReadStream(path string) (*os.File, error)
读取成数据流 Read and return Stream
func (*Filesystem) Rename ¶ added in v1.0.1007
func (this *Filesystem) Rename(path string, newpath string) (bool, error)
重命名 Rename path
func (*Filesystem) SetVisibility ¶ added in v1.0.1007
func (this *Filesystem) SetVisibility(path string, visibility string) (bool, error)
设置权限 SetVisibility
func (*Filesystem) UpdateStream ¶ added in v1.0.1007
func (this *Filesystem) UpdateStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
更新数据流 Update Stream
func (*Filesystem) WithAdapter ¶ added in v1.0.1007
func (this *Filesystem) WithAdapter(adapters interfaces.Adapter) *Filesystem
设置适配器 With Adapter
func (*Filesystem) WithConfig ¶ added in v1.0.1007
func (this *Filesystem) WithConfig(conf interfaces.Config)
设置配置 With Config
func (*Filesystem) WriteStream ¶ added in v1.0.1007
func (this *Filesystem) WriteStream(path string, resource io.Reader, conf ...map[string]any) (bool, error)
写入数据流 Write stream resource to path
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
*
- 扩展基础类 *
- @create 2021-8-1
- @author deatil
func (*Handler) SetFilesystem ¶
func (this *Handler) SetFilesystem(filesystem *Filesystem) 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(*Filesystem, string) any) any
获取 file := Get("/file.txt").(*File) dir := Get("/dir").(*Directory)
func (*MountManager) GetFilesystem ¶
func (this *MountManager) GetFilesystem(prefix string) *Filesystem
获取文件管理器
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 *Filesystem) *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 []byte, 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)
写入数据流