Documentation ¶
Index ¶
- Constants
- func All(dir string, opts ...walkOption) (filenames []string, err error)
- func Copy(from string, to string, opts ...copyOption) (err error)
- func Create(path string, opts ...option) (err error)
- func Delete(filename string) error
- func Dir() *optionType
- func Exists() *builder.Exists
- func File() *optionType
- func Is(path string, opts ...isOption) (is bool, err error)
- func List() *builder.List
- func Matchable(matchable matchable) *optionMatchable
- func Mode(mode os.FileMode) *optionMode
- func Move(from string, to string) error
- func Name(path string, opts ...nameOption) (filename string)
- func NewName(original string) (new string)
- func NewOptions(opts ...option) []option
- func NewOwner(uid int, gid int) *owner
- func NewWalkOptions(opts ...walkOption) []walkOption
- func Path(path string) *optionPaths
- func Paths(paths ...string) *optionPaths
- func Pattern(pattern string) *optionPattern
- func Prefix(prefix string) *optionPrefix
- func Regexp(regex string) *optionRegexp
- func Rename(from string, to string) (err error)
- func Source(source string) *optionSource
- func Suffix(suffix string) *optionSuffix
- func Type(_type _type) *optionType
- func Unzip(source string, target string) (err error)
- func ValidFilename(filename string) bool
- func ValidFilepath(filepath string) bool
- func Walk(dir string, handler walkHandler, opts ...walkOption) (err error)
- func Watch(path string, watcher Watcher) (err error)
- func WriteMode(mode writeMode) *optionWriteMode
- func Zip(target string, source string, opts ...zipOption) (err error)
- type Watcher
Constants ¶
View Source
const ( // TypeFile 文件 TypeFile _type = 1 // TypeDir 目录 TypeDir _type = 2 )
View Source
const ( // WriteModeSkip 跳过 WriteModeSkip writeMode = 1 // WriteModeOverride 覆盖 WriteModeOverride writeMode = 2 // WriteModeError 返回错误 WriteModeError writeMode = 3 // WriteModeRename 重命名 WriteModeRename writeMode = 4 )
Variables ¶
This section is empty.
Functions ¶
func NewWalkOptions ¶ added in v0.1.1
func NewWalkOptions(opts ...walkOption) []walkOption
NewWalkOptions 暴露给外部使用的快捷方法
Types ¶
type Watcher ¶ added in v0.0.9
type Watcher interface { // OnCreated 当文件被创建 OnCreated(path string) // OnChanged 文件发生改变时 OnChanged(path string) // OnDeleted 文件被删除时 OnDeleted(path string) // OnRenamed 文件被重命名时 OnRenamed(path string) // OnPermissionChanged 文件权限改变时 OnPermissionChanged(path string) // OnError 当发生错误时 OnError(err error) }
Watcher 文件监控
Source Files ¶
- copy.go
- copy_builder.go
- copy_option.go
- copy_params.go
- error.go
- exists.go
- file.go
- is_option.go
- list.go
- matchable.go
- matchable_pattern.go
- name.go
- name_option.go
- option.go
- option_matchable.go
- option_mode.go
- option_paths.go
- option_pattern.go
- option_prefix.go
- option_regex.go
- option_source.go
- option_suffix.go
- option_type.go
- option_write_mode.go
- owner.go
- type.go
- valid.go
- walk.go
- walk_handler.go
- walk_option.go
- watch.go
- watcher.go
- write_mode.go
- zip.go
- zip_option.go
Click to show internal directories.
Click to hide internal directories.