Documentation
¶
Overview ¶
Package filesystem implements extension interfaces and wrappers around the standard fs.FS.
Index ¶
- Constants
- func OpenFile(fsys fs.FS, name string, flag int, perm fs.FileMode) (fs.File, error)
- func StreamDir(ctx context.Context, count int, directory fs.ReadDirFile) <-chan StreamDirEntry
- func Truncate(fsys fs.FS, name string, size int64) error
- type AccessTimeInfo
- type ChangeTimeInfo
- type CreateFileFS
- type CreationTimeInfo
- type Host
- type ID
- type IDFS
- type MkdirFS
- type OpenFileFS
- type RemoveFS
- type RenameFS
- type StreamDirEntry
- type StreamDirFile
- type SymlinkFS
- type TruncateFile
- type TruncateFileFS
Constants ¶
View Source
const ( ExecuteOther fs.FileMode = 1 << iota WriteOther ReadOther ExecuteGroup WriteGroup ReadGroup ExecuteUser WriteUser ReadUser Root = "." ErrPath = generic.ConstError("path not valid") ErrNotFound = generic.ConstError("file not found") ErrNotOpen = generic.ConstError("file is not open") ErrIsDir = generic.ConstError("file is a directory") ErrIsNotDir = generic.ConstError("file is not a directory") )
Go file permission bits.
Variables ¶
This section is empty.
Functions ¶
func StreamDir ¶
func StreamDir(ctx context.Context, count int, directory fs.ReadDirFile) <-chan StreamDirEntry
StreamDir reads the directory and returns a channel of directory entry results.
If `directory` implements StreamDirFile, StreamDir calls `directory.StreamDir`. Otherwise, StreamDir calls `directory.ReadDir` repeatedly with `count` until the entire directory is read, an error is encountered, or the context is done.
Types ¶
type ID ¶
type ID string
ID represents a particular file system implementation. (IPFS, IPNS, et al.)
type OpenFileFS ¶
type StreamDirEntry ¶
type StreamDirFile ¶
type StreamDirFile interface { fs.ReadDirFile // StreamDir shares [fs.ReadDirFile]'s position, // and sends entries until either the last entry // is sent or the directory is closed. StreamDir() <-chan StreamDirEntry }
A StreamDirFile is a directory file whose entries can be received with the StreamDir method.
Directories
¶
Path | Synopsis |
---|---|
Package p9 implements file systems for the Plan 9 File Protocol.
|
Package p9 implements file systems for the Plan 9 File Protocol. |
Package cgofuse implements a wrapper around [fs.FS] to make it compatible with the [fuse.FileSystemHost] interface.
|
Package cgofuse implements a wrapper around [fs.FS] to make it compatible with the [fuse.FileSystemHost] interface. |
lock
Package lock implements file system operation locks based around hierarchical `/` delimited paths.
|
Package lock implements file system operation locks based around hierarchical `/` delimited paths. |
Package errors defines a set of annotations to be used when translating between [fs.PathError] and non-Go error values.
|
Package errors defines a set of annotations to be used when translating between [fs.PathError] and non-Go error values. |
Package ipfs implements [fs.FS] wrappers around various IPFS APIS.
|
Package ipfs implements [fs.FS] wrappers around various IPFS APIS. |
Click to show internal directories.
Click to hide internal directories.