Documentation
¶
Index ¶
Constants ¶
View Source
const ( ModeDir = gofs.ModeDir ModePerm = gofs.ModePerm )
View Source
const ( FlagReadOnly = FileOpenFlag(os.O_RDONLY) FlagWriteOnly = FileOpenFlag(os.O_WRONLY) FlagReadWrite = FileOpenFlag(os.O_RDWR) FlagCreate = FileOpenFlag(os.O_CREATE) )
Variables ¶
View Source
var ( ErrInvalid = gofs.ErrInvalid // "invalid argument" ErrPermission = gofs.ErrPermission // "permission denied" ErrExist = gofs.ErrExist // "file already exists" ErrNotExist = gofs.ErrNotExist // "file does not exist" ErrClosed = gofs.ErrClosed // "file already closed" )
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS interface { io.Closer gofs.FS gofs.ReadDirFS gofs.StatFS // OpenFile opens a file using the given flags. // By passing O_RDWR, the file can be opened for writing. OpenFile(path string, flag FileOpenFlag) (File, error) // MkdirAll creates a directory named path, along with any necessary parents. MkdirAll(path string) error // RemoveAll removes path and any children it contains. RemoveAll(path string) error // Rename renames (moves) oldpath to newpath. Rename(oldPath, newPath string) error }
FS is the interface implemented by a writeable file system.
type File ¶
type File interface { FileReadOnly io.Writer io.Seeker io.ReaderAt io.WriterAt Sync() error Truncate(size int64) error ExtendedAttributes() FileExtendedAttributes }
File is the interface implemented by a writeable file.
type FileExtendedAttributes ¶ added in v0.11.1
type FileExtendedAttributes interface { // Get returns the value of the extended attribute identified by name. Get(name string) ([]byte, error) // Set sets the value of the extended attribute identified by name. Set(name string, data []byte) error // Remove removes the extended attribute identified by name. Remove(name string) error // List returns the names of all extended attributes associated with the file. List() ([]string, error) // Sync flushes any metadata changes to the file system. Sync() error }
FileExtendedAttributes is an interface for working with file extended attributes.
type FileOpenFlag ¶ added in v0.6.0
type FileOpenFlag int
FileOpenFlag allows configuring how a file is opened.
func (FileOpenFlag) IsSet ¶ added in v0.10.0
func (f FileOpenFlag) IsSet(flag FileOpenFlag) bool
type FileReadOnly ¶ added in v0.6.0
FileReadOnly is the interface implemented by a read-only file. This is kept for compatibility with io/fs.
Click to show internal directories.
Click to hide internal directories.