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" ErrNoSuchAttr = fmt.Errorf("no such attribute") // "no such attribute" )
Functions ¶
This section is empty.
Types ¶
type ArchiveFS ¶ added in v0.13.0
type ArchiveFS interface { FS // Archive creates a tar archive of the directory at the given path. Archive(path string) (io.ReadCloser, error) }
ArchiveFS is the interface implemented by a file system that can create tarballs. This useful for dowloading whole directories etc.
type ExtendedAttributes ¶ added in v0.12.0
type ExtendedAttributes 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 }
ExtendedAttributes is an interface for working with file extended attributes.
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 flushes any changes to the file system. Sync() error // Truncate changes the size of the file. Truncate(size int64) error // XAttrs returns the extended attributes of the file. // If the file system does not support extended attributes, // an error is returned. You should call Sync() after modifying // the extended attributes to ensure they are persisted. XAttrs() (ExtendedAttributes, error) }
File is the interface implemented by a writeable file.
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.