Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filesys ¶
type Filesys interface { Open(fname string) ReadFile List() []string Create(fname string) File Delete(fname string) Truncate(fname string) Rename(src, dst string) AtomicCreateWith(fname string, data []byte) // performance counters GetStats() Stats }
Filesys is a database-specific API for accessing the file system.
Note that an instance of this interface only exposes a single directory (there are no directory names in these methods).
Callers are expected to follow some rules when calling this API:
Open: fname should exist Create: fname should not exist Delete: fname should exist Truncate: fname should exist
func DirFs ¶
DirFs creates a Filesys backed by the OS, using basedir.
Creates basedir if it does not exist.
func FromAfero ¶
FromAfero creates an fs.Filesys from any Afero file system.
This implementation will use absolute filenames for the database files; use an afero.BasePathFs to make sure all database files are created within a particular directory.
Deletes all files named *.tmp, as a file-system recovery for AtomicCreateWith.