Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

otofune/drivethrough

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drivethrough

ドライブにあるファイルを HTTP で直接参照できるようにする

つかいかた

  1. Google Drive API を Google Developer Console で有効にする
  2. OAuth2 アプリをその他 (Others) カテゴリで作成する
  3. 実行する
    git clone https://github.com/otofune/drivethrough
    cd drivethrough
    export DT_GOOGLE_CLIENT_ID='your client ID'
    export DT_GOOGLE_CLIENT_SECRET='your client Secret'
    go run .
  4. curl "http://localhost:10000/example.txt" でドライブ直下にある "example.txt" が取れるようになる
  5. ENJOY

TODO

  • application/vnd.google-apps.shortcut に対応する
  • ディレクトリのキャッシュに期限を持つようにする
  • zap 入れてデバッグログを出せるようにする
  • 返却する値に Content-Length, Content-Type を付ける
  • Range リクエストをサポートする
  • エラーメッセージや README を英語にする
  • ディレクトリの際にファイルリストを返却する
  • 同じ名前を持つディレクトリファイルが複数あった場合すぐにエラーにせず子ディレクトリまで検知してみる

About

Access G drive by HTTP without authorization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages