I would like to create a very simple, easy-to-use GUI for the "sync" function of rclone using a go UI library, limited to S3 buckets.
The idea is that the user wouldn't have to install anything (not even rclone), just:
start the executable (statically compiled for Win / macOS / Linux)
provide the bucket name, key id, secret key, and local directory
press upload or download
The UI will invoke functions that are part of rclone and it will show rclone's output in a text window (including the current progress).
To achieve this, is it possible to:
invoke the sync function in the rclone code, passing the remote information explicitly (instead of relying on a remote configure with "rclone config")
capture the output of rclone (to redirect it)
I know I could install rclone, configure a remote, and capture the output of a command-line invocation, and that would be much easier for me, but I'd like to simplify things as much as possible for the user.
This makes sense, since RcloneBrowser was developed in C++, while rclone is in Go.
But I was hoping that, by developing the GUI in Go, I could avoid the requirement for a separate installation of rclone.
I guess you can compile your code into rclone and then do something similar to the rclone webgui or the unit test of the rc server, though I am not sure exactly how they trigger the loop-back.
If I were in your situation, then I would prefer to call the officially compiled rclone binary at the expense of an extra file in the distribution zip. This just makes it much easier to determine if an issue is due to your own code or rclone - and you have better tools to troubleshoot and report any issues encountered by your users.