I need to open a file from the plugin’s setup function. I want this filename to be relative to the location of the Caddyfile (well Corefile in this case). This information is available, but not exported.
The setup function gets a *caddy.Controller which has an *Instance, which has a caddyFileInput on which I could potentially do a FilePath, but… as said… all private fields. Is there another way that I’m overlooking?
Actually I’m looking more and more at exporting the Instance field on the Controller, since it could be useful for middlewares to be able to control when the Instance restarts or something (but I also don’t want to let people be able to shoot themselves in the foot).