27 lines
745 B
Go
27 lines
745 B
Go
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
|
|
}
|