Documentation ¶
Index ¶
- Constants
- func IsSymlink(fileMode fs.FileMode) bool
- func Walk(fs Fs, path string, walkFunc filepath.WalkFunc, options WalkOptions) error
- type File
- type Fs
- type OsFs
- func (fs *OsFs) Chmod(name string, mode os.FileMode) error
- func (fs *OsFs) Create(name string) (File, error)
- func (fs *OsFs) Lstat(path string) (os.FileInfo, error)
- func (fs *OsFs) Mkdir(path string, perm os.FileMode) error
- func (fs *OsFs) MkdirAll(path string, perm os.FileMode) error
- func (fs *OsFs) Open(name string) (File, error)
- func (fs *OsFs) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (fs *OsFs) ReadDir(path string) ([]os.FileInfo, error)
- func (fs *OsFs) ReadFile(path string) ([]byte, error)
- func (fs *OsFs) Readlink(path string) (string, error)
- func (fs *OsFs) Remove(path string) error
- func (fs *OsFs) RemoveAll(path string) error
- func (fs *OsFs) Rename(oldname, newname string) error
- func (fs *OsFs) Stat(path string) (os.FileInfo, error)
- func (fs *OsFs) Symlink(oldname, newname string) error
- func (fs *OsFs) WriteFile(path string, data []byte, perm os.FileMode) error
- type WalkOptions
Constants ¶
View Source
const DefaultMaxConcurrency = 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File interface { io.Closer io.Reader io.ReaderAt io.Seeker io.Writer io.WriterAt Name() string Readdir(count int) ([]os.FileInfo, error) Readdirnames(n int) ([]string, error) Stat() (os.FileInfo, error) Sync() error Truncate(size int64) error WriteString(s string) (ret int, err error) }
afero's interface for a File
type Fs ¶
type Fs interface { Create(name string) (File, error) Remove(path string) error RemoveAll(path string) error Stat(path string) (os.FileInfo, error) Lstat(path string) (os.FileInfo, error) ReadDir(dirname string) ([]os.FileInfo, error) ReadFile(path string) ([]byte, error) Mkdir(path string, perm os.FileMode) error MkdirAll(path string, perm os.FileMode) error Open(path string) (File, error) WriteFile(path string, data []byte, perm os.FileMode) error Rename(old, new string) error OpenFile(name string, flag int, perm os.FileMode) (File, error) Symlink(oldName, newName string) error Chmod(name string, mode os.FileMode) error Readlink(path string) (string, error) }
type WalkOptions ¶
type WalkOptions struct { IncludesMatcher, ExcludesMatcher patternmatcher.Matcher MaxConcurrency uint // FollowSymlinks treats a symlink as if it were the file/directory underneath, effectively hiding the symlink from the consumer. // It can be used with a chain of symlinks, in which case it will keep following the links, until it reaches a non-symlink FollowSymlinks bool }
Click to show internal directories.
Click to hide internal directories.