News for hackers. Stuff that matters.
Re:Ask HN: Experience using your user's Google Drive instead... by mickael-kerjean on Monday December 04, 2023 @05:13PM (#38523902)
> I've often felt we need an abstraction for just this. "Bring your own storage"

I made exactly this: https://github.com/mickael-kerjean/filestash The public API enables programmatical access to S3, SFTP, FTP, GIT, WebDav, Samba, Local FS, NFS, Backblaze, Storj, Artifactory, .... and more. Under the hood, each storage implements this interface:

  type IBackend interface {
    Ls(path string) ([]os.FileInfo, error)
    Cat(path string) (io.ReadCloser, error)
    Mkdir(path string) error
    Rm(path string) error
    Mv(from string, to string) error
    Save(path string, file io.Reader) error
    Touch(path string) error
  }

There's some hook so you can define your own and do even more funky stuff like virtual FS wich compose onto anything you want/need. There's a bunch of weird implementation like the mysql storage, which represent first level folders as databases, second level folders as tables and files as the actual rows.

fun fact: it was born out of a reflection from the infamous top comment of the Dropbox launch on HN

Re:Ask HN: Experience using your user's Google Drive instead... by freedomben on Monday December 04, 2023 @05:21PM (#38524008)
Whoa, this is a solution I've looked for several times and can never find. Thanks!