Documentation
¶
Overview ¶
Package fs provides write file system interfaces and related functions that are not part of the regular Go standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotDir = errors.New("parent is not a directory")
Functions ¶
Types ¶
type CreateFS ¶
type CreateFS interface { fs.FS Create(name string) (FileWriter, error) // create or append to a file Chmod(name string, mode fs.FileMode) error // change the mode of the file Mkdir(name string, perm fs.FileMode) error // create a directory }
CreateFS is a file system that can create files.
type FileWriter ¶
type FileWriter interface { Chmod(fs.FileMode) error // change the file mode of the file Write([]byte) (int, error) // write data to the file Close() error // close the file for writing }
FileWriter is a writable file.
type ReaderFS ¶
ReaderFS combines all the reader file system interfaces into a single interface for convenience.
type ReaderWriterFS ¶
ReaderWriterFS combines all the reader and writer file system interfaces into a single interface for convenience.
type WriteFileFS ¶
type WriteFileFS interface { CreateFS // WriteFile writes out a complete file, creating or updating the file in // place using the given bytes. The file mode will be set as given as well. // Returns an error on failure. WriteFile(name string, data []byte, perm fs.FileMode) error }
WriteFileFS is a file system that can write files whole.
type WriterFS ¶
type WriterFS interface { WriteFileFS }
WriterFS combines the file system writer interfaces into a single interface for convenience.
Click to show internal directories.
Click to hide internal directories.