Intro
Hello,
So I am extending Caddy and there are a couple of things I could not find adequate documentation for.
First I’ll explain what I need, so that it’ll be more logical for you to understand.
Explanation
I am making a custom JWT ware module to extend Caddy to accomodate my specific needs, and to experiment with creating modules. The module I create will accept subdirectives which define useful stuff for example, the key identifier and storage to lookup in.
If I want to register a reusable socket to the database, that’s a PLUS, otherwise every module I make that requries a DB connection, ill need to make DB connection in
Provision
method of every module, which can be difficult to maintain, and nerfs the scalability. For that reason, I’ve planned to first make an MongoDB App. In Caddy anApp
is something that Caddy needs to run. So I found it very logical.Continuing from this, I know that a guest module can access any app from the context, but it is better to register it under the namespace of the app.
Now my confusion will start in a moment. I want to have support for Caddyfile, then the module directives can be given, but how to accept abritrary options to my
App
.