Documentation
¶
Index ¶
- Variables
- type AttrDirFlag
- type AttrDirIsRel
- type AttrDirMode
- type AttrDirPath
- type AttrFileFlag
- type AttrFileIsRel
- type AttrFileMode
- type AttrFilePath
- type Dir
- func (*Dir) Abs(attrs ...DirAttributer) *Dir
- func (my *Dir) Copy() *Dir
- func (my *Dir) CopyAllTo(isRel bool, dstPaths ...string) *Dir
- func (my *Dir) CopyDirsTo(isRel bool, dstPaths ...string) *Dir
- func (my *Dir) CopyFilesTo(isRel bool, dstPaths ...string) *Dir
- func (my *Dir) Create(attrs ...DirOperationAttributer) *Dir
- func (my *Dir) Join(dirs ...string) *Dir
- func (my *Dir) LS() *Dir
- func (my *Dir) Lock() *Dir
- func (*Dir) New(attrs ...DirAttributer) *Dir
- func (my *Dir) RLock() *Dir
- func (my *Dir) RUnlock() *Dir
- func (*Dir) Rel(attrs ...DirAttributer) *Dir
- func (my *Dir) Remove() *Dir
- func (my *Dir) RemoveAll() *Dir
- func (my *Dir) Rename(newName string) *Dir
- func (my *Dir) SetAttrs(attrs ...DirAttributer) *Dir
- func (my *Dir) Unlock() *Dir
- func (my *Dir) Up() *Dir
- type DirAttributer
- type DirOperation
- type DirOperationAttributer
- type File
- func (*File) Abs(attrs ...FileAttributer) *File
- func (my *File) Copy() *File
- func (my *File) CopyTo(isRel bool, dstPaths ...string) *File
- func (my *File) Create(attrs ...FileOperationAttributer) *File
- func (my *File) Join(dirs ...string) *File
- func (my *File) Lock() *File
- func (*File) New(attrs ...FileAttributer) *File
- func (my *File) RLock() *File
- func (my *File) RUnlock() *File
- func (my *File) Read(attrs ...FileOperationAttributer) ([]byte, error)
- func (*File) Rel(attrs ...FileAttributer) *File
- func (my *File) Remove() *File
- func (my *File) Rename(newName string) *File
- func (my *File) SetAttrs(attrs ...FileAttributer) *File
- func (my *File) Unlock() *File
- func (my *File) Write(content []byte, attrs ...FileOperationAttributer) *File
- type FileAttributer
- type FileOperation
- type FileOperationAttributer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInit = fmt.Errorf("获取文件或目录信息失败") ErrMissFullPath = fmt.Errorf("文件或目录完整路径不能为空") ErrRename = fmt.Errorf("修改文件名失败") ErrRemove = fmt.Errorf("删除文件失败") ErrFileNotExist = fmt.Errorf("文件不存在") ErrCreateFile = fmt.Errorf("创建文件失败") ErrWriteFile = fmt.Errorf("写入文件失败") ErrReadFile = fmt.Errorf("读取文件失败") ErrOpenFile = fmt.Errorf("打开文件失败") ErrDirNotExist = fmt.Errorf("目录不存在") ErrCreateDir = fmt.Errorf("创建目录失败") ErrReadDir = fmt.Errorf("读取目录失败") )
View Source
var ( DefaultCreateMode = os.O_APPEND | os.O_CREATE | os.O_WRONLY DefaultReadMode = os.O_RDWR )
View Source
var APP struct { Dir Dir DirAttr struct { Path AttrDirPath IsRel AttrDirIsRel } File File FileAttr struct { Path AttrFilePath IsRel AttrFileIsRel } }
Functions ¶
This section is empty.
Types ¶
type AttrDirFlag ¶
type AttrDirFlag struct {
// contains filtered or unexported fields
}
func (AttrDirFlag) Register ¶
func (my AttrDirFlag) Register(o *DirOperation)
type AttrDirIsRel ¶
type AttrDirIsRel struct {
// contains filtered or unexported fields
}
******************** 管理器属性 ******************** //
func (AttrDirIsRel) Register ¶
func (my AttrDirIsRel) Register(dir *Dir)
func (AttrDirIsRel) Set ¶ added in v1.53.3
func (AttrDirIsRel) Set(isRel bool) AttrDirIsRel
func (AttrDirIsRel) SetAbs ¶ added in v1.53.3
func (AttrDirIsRel) SetAbs() AttrDirIsRel
func (AttrDirIsRel) SetRel ¶ added in v1.53.3
func (AttrDirIsRel) SetRel() AttrDirIsRel
type AttrDirMode ¶
type AttrDirMode struct {
// contains filtered or unexported fields
}
func (AttrDirMode) Register ¶
func (my AttrDirMode) Register(o *DirOperation)
type AttrDirPath ¶
type AttrDirPath struct {
// contains filtered or unexported fields
}
******************** 管理器属性 ******************** //
func (AttrDirPath) Join ¶
func (my AttrDirPath) Join(dirs ...string) AttrDirPath
func (AttrDirPath) Register ¶
func (my AttrDirPath) Register(dir *Dir)
func (AttrDirPath) Set ¶ added in v1.53.3
func (AttrDirPath) Set(vals ...string) AttrDirPath
type AttrFileFlag ¶
type AttrFileFlag struct {
// contains filtered or unexported fields
}
func FileFlag ¶
func FileFlag(flag int) AttrFileFlag
func (AttrFileFlag) Register ¶
func (my AttrFileFlag) Register(o *FileOperation)
type AttrFileIsRel ¶
type AttrFileIsRel struct {
// contains filtered or unexported fields
}
******************** 管理器属性 ******************** //
func (AttrFileIsRel) Register ¶
func (my AttrFileIsRel) Register(dir *File)
func (AttrFileIsRel) Set ¶ added in v1.53.3
func (my AttrFileIsRel) Set(isRel bool) AttrFileIsRel
func (AttrFileIsRel) SetAbs ¶ added in v1.53.3
func (AttrFileIsRel) SetAbs() AttrFileIsRel
func (AttrFileIsRel) SetRel ¶ added in v1.53.3
func (AttrFileIsRel) SetRel() AttrFileIsRel
type AttrFileMode ¶
type AttrFileMode struct {
// contains filtered or unexported fields
}
func FileMode ¶
func FileMode(mode os.FileMode) AttrFileMode
func (AttrFileMode) Register ¶
func (my AttrFileMode) Register(o *FileOperation)
type AttrFilePath ¶
type AttrFilePath struct {
// contains filtered or unexported fields
}
******************** 管理器属性 ******************** //
func (AttrFilePath) Join ¶
func (my AttrFilePath) Join(dirs ...string) AttrFilePath
func (AttrFilePath) Register ¶
func (my AttrFilePath) Register(file *File)
func (AttrFilePath) Set ¶ added in v1.53.3
func (AttrFilePath) Set(vals ...string) AttrFilePath
type Dir ¶
type Dir struct {
IsRel bool // 是否使用相对路径
Error error // 错误信息
Name string // 文件名
BasePath string // 基础路径
FullPath string // 完整路径
Size int64 // 文件大小
Info os.FileInfo // 文件信息
Mode os.FileMode // 文件权限
Exist bool // 文件是否存在
Files []*File // 目录下的文件列表
Dirs []*Dir // 子目录列表
// contains filtered or unexported fields
}
func (*Dir) CopyDirsTo ¶
CopyDirsTo 复制当前目录下的所有子目录到目标路径
func (*Dir) CopyFilesTo ¶
CopyFilesTo 复制当前目录下的所有文件到目标路径
type DirAttributer ¶
type DirAttributer interface{ Register(dir *Dir) }
******************** 管理器属性 ******************** //
type DirOperation ¶
******************** 目录操作属性 ******************** //
func (*DirOperation) SetAttrs ¶
func (my *DirOperation) SetAttrs(attrs ...DirOperationAttributer) *DirOperation
type DirOperationAttributer ¶
type DirOperationAttributer interface{ Register(o *DirOperation) }
func DirFlag ¶
func DirFlag(flag int) DirOperationAttributer
func DirMode ¶
func DirMode(mode os.FileMode) DirOperationAttributer
type File ¶
type File struct {
IsRel bool // 是否使用相对路径
Error error // 错误信息
Name string // 文件名
BasePath string // 基础路径
FullPath string // 完整路径
Size int64 // 文件大小
Info os.FileInfo // 文件信息
Mode os.FileMode // 文件权限
Exist bool // 文件是否存在
Extension string // 文件扩展名
Fileinfo os.FileInfo // 文件信息
Mime string // 文件Mime类型
// contains filtered or unexported fields
}
type FileAttributer ¶
type FileAttributer interface{ Register(dir *File) }
******************** 管理器属性 ******************** //
type FileOperation ¶
******************** 文件操作属性 ******************** //
func (*FileOperation) SetAttrs ¶
func (my *FileOperation) SetAttrs(attrs ...FileOperationAttributer) *FileOperation
type FileOperationAttributer ¶
type FileOperationAttributer interface{ Register(o *FileOperation) }
Click to show internal directories.
Click to hide internal directories.