Documentation ¶
Index ¶
- type FileManager
- func (r *FileManager) Delete() error
- func (FileManager) New(config *FileManagerConfig) *FileManager
- func (FileManager) NewByBytes(srcFileBytes []byte, dstDir string, config *FileManagerConfig) *FileManager
- func (FileManager) NewByLocalFile(srcDir, dstDir string, config *FileManagerConfig) (*FileManager, error)
- func (r *FileManager) SetDstDir(dstDir string) *FileManager
- func (r *FileManager) SetSrcDir(srcDir string) (*FileManager, error)
- func (r *FileManager) Upload() (int64, error)
- type FileManagerConfig
- type FileManagerConfigDriver
- type FileSystem
- func (r *FileSystem) CheckPathType() error
- func (r *FileSystem) Copy() *FileSystem
- func (r *FileSystem) CopyDir(dstDir string, abs bool) error
- func (r *FileSystem) CopyFile(dstDir, dstFilename string, abs bool) error
- func (FileSystem) CopyFiles(srcFiles []*FileSystemCopyFilesTarget, dstDir string, abs bool) error
- func (r *FileSystem) DelDir() error
- func (r *FileSystem) DelFile() error
- func (r *FileSystem) Delete() error
- func (r *FileSystem) Exist() (bool, error)
- func (FileSystem) GetCurrentPath(paths ...string) string
- func (r *FileSystem) GetDir() string
- func (FileSystem) GetRootPath() string
- func (r *FileSystem) Join(dir string) *FileSystem
- func (r *FileSystem) Joins(dir ...string) *FileSystem
- func (r *FileSystem) MkDir() error
- func (FileSystem) NewByAbs(dir string) *FileSystem
- func (FileSystem) NewByRelative(dir string) *FileSystem
- func (r *FileSystem) Read() ([]byte, error)
- func (r *FileSystem) SetDirByAbs(dir string) *FileSystem
- func (r *FileSystem) SetDirByRelative(dir string) *FileSystem
- func (r *FileSystem) WriteBytes(content []byte) (int64, error)
- func (r *FileSystem) WriteBytesAppend(content []byte) (int64, error)
- func (r *FileSystem) WriteIoReader(content io.Reader) (written int64, err error)
- func (r *FileSystem) WriteIoReaderAppend(content io.Reader) (int64, error)
- func (r *FileSystem) WriteString(content string) (int64, error)
- func (r *FileSystem) WriteStringAppend(content string) (int64, error)
- type FileSystemCopyFilesTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileManager ¶
type FileManager struct { Err error // contains filtered or unexported fields }
var FileManagerApp FileManager
func (FileManager) New ¶
func (FileManager) New(config *FileManagerConfig) *FileManager
New 初始化:文件管理
func (FileManager) NewByBytes ¶
func (FileManager) NewByBytes(srcFileBytes []byte, dstDir string, config *FileManagerConfig) *FileManager
NewByBytes 实例化:文件管理器(通过字节)
func (FileManager) NewByLocalFile ¶
func (FileManager) NewByLocalFile(srcDir, dstDir string, config *FileManagerConfig) (*FileManager, error)
NewByLocalFile 初始化:文件管理器(通过本地文件)
func (*FileManager) SetDstDir ¶
func (r *FileManager) SetDstDir(dstDir string) *FileManager
SetDstDir 设置目标目录
func (*FileManager) SetSrcDir ¶
func (r *FileManager) SetSrcDir(srcDir string) (*FileManager, error)
SetSrcDir 设置源文件
type FileManagerConfig ¶
type FileManagerConfig struct { Username string Password string AuthTitle string Driver FileManagerConfigDriver }
type FileManagerConfigDriver ¶
type FileManagerConfigDriver = string
const ( FileManagerConfigDriverLocal FileManagerConfigDriver = "LOCAL" FileManagerConfigDriverNexus FileManagerConfigDriver = "NEXUS" FileManagerConfigDriverOss FileManagerConfigDriver = "OSS" )
type FileSystem ¶
type FileSystem struct { IsExist bool IsDir bool IsFile bool // contains filtered or unexported fields }
FileSystem 文件系统
var FileSystemApp FileSystem
func (*FileSystem) CheckPathType ¶
func (r *FileSystem) CheckPathType() error
CheckPathType 判断一个路径是文件还是文件夹
func (*FileSystem) CopyDir ¶
func (r *FileSystem) CopyDir(dstDir string, abs bool) error
CopyDir 拷贝目录
func (*FileSystem) CopyFile ¶
func (r *FileSystem) CopyFile(dstDir, dstFilename string, abs bool) error
CopyFile 拷贝单文件
func (FileSystem) CopyFiles ¶
func (FileSystem) CopyFiles(srcFiles []*FileSystemCopyFilesTarget, dstDir string, abs bool) error
CopyFiles 拷贝多个文件
func (FileSystem) GetCurrentPath ¶
func (FileSystem) GetCurrentPath(paths ...string) string
GetCurrentPath 最终方案-全兼容
func (FileSystem) GetRootPath ¶
func (FileSystem) GetRootPath() string
func (*FileSystem) Join ¶
func (r *FileSystem) Join(dir string) *FileSystem
func (FileSystem) NewByAbs ¶
func (FileSystem) NewByAbs(dir string) *FileSystem
NewByAbs 实例化:文件系统(绝对路径)
func (FileSystem) NewByRelative ¶
func (FileSystem) NewByRelative(dir string) *FileSystem
NewByRelative 实例化:文件系统(相对路径)
func (*FileSystem) SetDirByAbs ¶
func (r *FileSystem) SetDirByAbs(dir string) *FileSystem
SetDirByAbs 设置路径:绝对路径
func (*FileSystem) SetDirByRelative ¶
func (r *FileSystem) SetDirByRelative(dir string) *FileSystem
SetDirByRelative 设置路径:相对路径
func (*FileSystem) WriteBytes ¶
func (r *FileSystem) WriteBytes(content []byte) (int64, error)
WriteBytes 写入文件:bytes
func (*FileSystem) WriteBytesAppend ¶
func (r *FileSystem) WriteBytesAppend(content []byte) (int64, error)
WriteBytesAppend 追加写入文件:bytes
func (*FileSystem) WriteIoReader ¶
func (r *FileSystem) WriteIoReader(content io.Reader) (written int64, err error)
WriteIoReader 写入文件:io.Reader
func (*FileSystem) WriteIoReaderAppend ¶
func (r *FileSystem) WriteIoReaderAppend(content io.Reader) (int64, error)
WriteIoReaderAppend 追加写入文件:io.Reader
func (*FileSystem) WriteString ¶
func (r *FileSystem) WriteString(content string) (int64, error)
WriteString 写入文件:string
func (*FileSystem) WriteStringAppend ¶
func (r *FileSystem) WriteStringAppend(content string) (int64, error)
WriteStringAppend 追加写入文件:string
type FileSystemCopyFilesTarget ¶
type FileSystemCopyFilesTarget struct { Src *FileSystem DstFilename string }
FileSystemCopyFilesTarget 拷贝文件目标
Click to show internal directories.
Click to hide internal directories.