Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS interface { ReaderFS WriterFS // Remove removes the provided path from the underlying storage. Remove(path string) error }
FS is the interface that groups all file system operations
type LocalFS ¶
type LocalFS struct {
// contains filtered or unexported fields
}
func NewLocalFS ¶
NewLocalFS creates a new LocalFS where all files are opened and created relative to the basedir provided. Very much like a chroot on the provided basedir.
type ReaderFS ¶
type ReaderFS interface { // Open opens the provided path for reading Open(path string) (io.ReadCloser, error) // ReadAll opens the path for reading and reads all its contents // returning them as an byte array. ReadAll(path string) ([]byte, error) }
ReaderFS is the interface that groups the basic Read file system methods.
type WriterFS ¶
type WriterFS interface { // Create creates the provided path as a file ready for writing. // If the file already exists the file will be truncated. Create(path string) (io.WriteCloser, error) // Create creates the provided path as a file ready for writing // and writes all the contents to it, closing it afterwards. WriteAll(path string, contents []byte) error }
WriterFS is the interface that groups the basic Read file system methods.
Click to show internal directories.
Click to hide internal directories.