Since there’s documentation for it already, I’d recommend implementing it as a plugin first. Your code can be a Caddy app, which plugs into the Caddy lifecycle.
I’m not sure how the “Caddy as an embedded server” usecase looks as of v2. I think source-diving is your best option for the time being. The code is pretty well commented, so it shouldn’t be too difficult to figure out.
Let us know if you have any more specific questions!
Thank you @francislavoie. The plugin documentation looks to be pretty good. I’ll read it and will decide if it makes sense for my project.
As for the source-diving… I’ll have to find some time. I’m still in the learning phase for GO, so I think it would take me a fair amount of time.