LoadConfig() from a string

I am trying to use rclone by importing the source directly in a golang project to run copy/delete commands. What I want to know is, if its possible for LoadConfig to accept a string as an argument instead of reading config from a file?

I know I can just fork it and modify the program to accept it as an argument but is there already a way to do this? I want to pass s3 details to rclone to detect remote correctly when I parse and create FS from path.

What you can do is set environment variables - you can create the whole config like that.

https://rclone.org/docs/#config-file

There are config reading and setting hooks you can override here also

1 Like

Thanks! Yeah I saw that route of exporting all the env vars as well but I though that will be dirty implementation when I already have env vars of my own application. I think ConfigFileSet/Get should be good for my use case, I'll try and report back.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.