Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/squat/drivefs
Use Google Drive as a static file server
https://github.com/squat/drivefs
golang google-drive http-server static
Last synced: 8 days ago
JSON representation
Use Google Drive as a static file server
- Host: GitHub
- URL: https://github.com/squat/drivefs
- Owner: squat
- License: mit
- Created: 2018-04-03T18:14:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T00:00:18.000Z (over 6 years ago)
- Last Synced: 2024-10-28T15:50:46.161Z (about 2 months ago)
- Topics: golang, google-drive, http-server, static
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drivefs
drivefs allows you to serve static files in your Go application from Google Drive using the familiar http.FileSystem interface.
[![Go Report Card](https://goreportcard.com/badge/github.com/squat/drivefs)](https://goreportcard.com/report/github.com/squat/drivefs)
[![Documentation](https://godoc.org/github.com/squat/drivefs?status.svg)](http://godoc.org/github.com/squat/drivefs)## Usage
```go
import (
"log"
"net/http""google.golang.org/api/drive/v3"
"github.com/squat/drivefs"
)func main() {
...
driveService, err := drive.New(oauthHttpClient)
// Handle error.
if err != nil {
log.Fatal(err)
}
fs := drivefs.New(driveService)
// Simple static webserver:
log.Fatal(http.ListenAndServe(":8080", http.FileServer(fs)))
}
```