initial commit

This commit is contained in:
2025-01-18 20:03:40 -06:00
commit f54150c3d2
26 changed files with 1934 additions and 0 deletions

26
vfs/vfs.go Normal file
View File

@@ -0,0 +1,26 @@
package vfs
// VFS is the interface that wraps the basic methods of a virtual file system.
type VFS interface {
// Name returns the name of the file system.
Name() string
// Size returns the total size of all files in the file system.
Size() int64
// Set sets the value of key as src.
// Setting the same key multiple times, the last set call takes effect.
Set(key string, src []byte) error
// Delete deletes the value of key.
Delete(key string) error
// Get gets the value of key to dst, and returns dst no matter whether or not there is an error.
Get(key string) ([]byte, error)
// Stat returns the FileInfo of key.
Stat(key string) (*FileInfo, error)
// StatAll returns the FileInfo of all keys.
StatAll() []*FileInfo
}