GDriveDisk is a virtual ROM disk that mounts Google Drive as a high-speed memory drive, allowing temporary storage that syncs with Google Drive in real-time.
✅ Mount Google Drive as a Virtual File System (FUSE)
✅ Fast Read/Write Operations with Caching
✅ Bloom Filters for Quick File Lookup
✅ Redis Cache to Reduce API Calls
✅ Adaptive Prefetching Algorithm
- GoLang (Concurrency & Performance)
- Google Drive API (Cloud File Storage)
- FUSE (Filesystem in Userspace) (Virtual Drive)
- Redis (Fast Caching)
- Bloom Filters (Quick Lookup)
sudo apt install golang
go version
go get -u bazil.org/fuse
go get -u golang.org/x/oauth2
go get -u google.golang.org/api/drive/v3
go get -u github.com/go-redis/redis/v8
go get -u github.com/bits-and-blooms/bloom/v3- Go to Google Cloud Console
- Enable Google Drive API
- Create OAuth 2.0 credentials
- Download
credentials.jsonand place it in the project root
go run auth.gogo run main.go✅ Drive will be mounted at
/mnt/gdrive
content, err := readFile("file_id", driveService)
if err != nil {
log.Fatal(err)
}
fmt.Println("File Content:", string(content))err := writeFile("test.txt", []byte("Hello from RAM Disk!"), driveService)
if err != nil {
log.Fatal(err)
}
fmt.Println("File Uploaded Successfully!")cacheFile("test.txt", []byte("Cached Content"))
data, err := getCachedFile("test.txt")
fmt.Println("Cached Data:", string(data))addToBloomFilter("test.txt")
if isFileInCache("test.txt") {
fmt.Println("File exists in cache!")
}- Frequently accessed files are stored in Redis
- Reduces API calls and speeds up access
- Uses access patterns to predict next files
- Loads them into memory for faster access
Want to improve GDriveDisk? Feel free to submit PRs & Issues!
This project is licensed under MIT License.
If you like this project, give it a star ⭐ and contribute!