API for a lite client (PoC complete)

Hi! If you’re on IRC(or matrix) you might have seen that I’ve been working on a lite client for syncthing. The goal is to implement a go package that is capable of connecting to a syncthing cluster to retrieve a filelist and allow you to upload/download files without a full sync. This can be useful for mobile clients or something like rclone(https://rclone.org/). But I’ve also been thinking about using it as a ownCload alternative. Apps could implement it directly like note taking apps and so on. Using something like tinygo it might be possible to build a web assembly package and make a file manager for the web browser.

One of the most important things to get right is the API. Which is why I’ve put that on github as a start. If this sounds interesting have a look and give me your comments. I have a 12h flight in front of me so I hope to get a lot of work done then.

Doc’s can be found here https://godoc.org/github.com/VictorNine/syncthingclient

1 Like

My first thoughts are that you’ll need some certificate stuff on the Client, and that the upload API might be annoying to implement. Syncthing doesn’t treat files as streams so you’ll have to buffer the whole thing in ram or on disk to have hashed blocks available for upload. Given that, you might instead have an interface that can serve blocks, and an implementation of it on top of disk files / memory slice that the API consumer can use.

1 Like

Forgot the certificate part I’ll update.

Ahrg you are correct you off course need all the block hashes for the index. I’ll have to rethink that then.

update: Thinking about it, it doesn’t make sense to have a reader on download either. If your downloading an update it would be nice to just sync them.

I’ve updated and changed to using files in the API. Not optimal but this could be changed later when everything works.

I think you are focusing too much on API before the implementation is there.

You should try to implement it first, which will then give you an idea what you need to construct the client. I think certs etc is not enough, you’ll need a config, etc, etc.

Everything needed to download files is now on github. If you see any thing that can be replaced with code from the syncthing lib please comment or send a PR.