Some checks failed
PR Check / check-and-test (pull_request) Failing after 11m4s
- Updated disk_test.go to replace Set and Get with Create and Open methods for better clarity and functionality. - Modified fileinfo.go to include package comment. - Refactored gc.go to streamline garbage collection handling and removed unused statistics. - Updated gc_test.go to comment out large random tests for future implementation. - Enhanced memory.go to implement LRU caching and metrics for memory usage. - Updated memory_test.go to replace Set and Get with Create and Open methods. - Removed sync.go as it was redundant and not utilized. - Updated vfs.go to reflect changes in the VFS interface, replacing Set and Get with Create and Open. - Added package comments to vfserror.go for consistency.
29 lines
681 B
Go
29 lines
681 B
Go
// vfs/vfs.go
|
|
package vfs
|
|
|
|
import "io"
|
|
|
|
// 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
|
|
|
|
// Create creates a new file at key with expected size.
|
|
Create(key string, size int64) (io.WriteCloser, error)
|
|
|
|
// Delete deletes the value of key.
|
|
Delete(key string) error
|
|
|
|
// Open opens the file at key.
|
|
Open(key string) (io.ReadCloser, error)
|
|
|
|
// Stat returns the FileInfo of key.
|
|
Stat(key string) (*FileInfo, error)
|
|
|
|
// StatAll returns the FileInfo of all keys.
|
|
StatAll() []*FileInfo
|
|
}
|