MCPcopy
hub / github.com/syncthing/syncthing / Filesystem

Interface Filesystem

lib/fs/filesystem.go:31–65  ·  view source on GitHub ↗

The Filesystem interface abstracts access to the file system.

Source from the content-addressed store, hash-verified

29
30// The Filesystem interface abstracts access to the file system.
31type Filesystem interface {
32 Chmod(name string, mode FileMode) error
33 Lchown(name string, uid, gid string) error // uid/gid as strings; numeric on POSIX, SID on Windows, like in os/user package
34 Chtimes(name string, atime time.Time, mtime time.Time) error
35 Create(name string) (File, error)
36 CreateSymlink(target, name string) error
37 DirNames(name string) ([]string, error)
38 Lstat(name string) (FileInfo, error)
39 Mkdir(name string, perm FileMode) error
40 MkdirAll(name string, perm FileMode) error
41 Open(name string) (File, error)
42 OpenFile(name string, flags int, mode FileMode) (File, error)
43 ReadSymlink(name string) (string, error)
44 Remove(name string) error
45 RemoveAll(name string) error
46 Rename(oldname, newname string) error
47 Stat(name string) (FileInfo, error)
48 Walk(name string, walkFn WalkFunc) error
49 // If setup fails, returns non-nil error, and if afterwards a fatal (!)
50 // error occurs, sends that error on the channel. Afterwards this watch
51 // can be considered stopped.
52 Watch(path string, ignore Matcher, ctx context.Context, ignorePerms bool) (<-chan Event, <-chan error, error)
53 Hide(name string) error
54 Unhide(name string) error
55 Glob(pattern string) ([]string, error)
56 Roots() ([]string, error)
57 Usage(name string) (Usage, error)
58 Type() FilesystemType
59 URI() string
60 Options() []Option
61 SameFile(fi1, fi2 FileInfo) bool
62 PlatformData(name string, withOwnership, withXattrs bool, xattrFilter XattrFilter) (protocol.PlatformData, error)
63 GetXattr(name string, xattrFilter XattrFilter) ([]protocol.Xattr, error)
64 SetXattr(path string, xattrs []protocol.Xattr, xattrFilter XattrFilter) error
65}
66
67type wrappingFilesystem interface {
68 // Used for unwrapping things

Callers 197

TestOSWindowsRemoveFunction · 0.95
TestOSWindowsRemoveAllFunction · 0.95
EnsureDirFunction · 0.95
copyFileFunction · 0.65
tempFileInWritableDirMethod · 0.65
writeFilePermFunction · 0.65
TestDeleteIgnorePermsFunction · 0.65
TestScanOwnershipPOSIXFunction · 0.95
syncOwnershipMethod · 0.65
TestCopyOwnerFunction · 0.65
syncOwnershipMethod · 0.65

Implementers 4

BasicFilesystemlib/fs/basicfs.go
metricsFSlib/fs/metrics.go
fakeFSlib/fs/fakefs.go
errorFilesystemlib/fs/errorfs.go

Calls

no outgoing calls

Tested by

no test coverage detected