MCPcopy
hub / github.com/caddyserver/caddy / Provision

Method Provision

modules/caddypki/adminapi.go:49–62  ·  view source on GitHub ↗

Provision sets up the adminAPI module.

(ctx caddy.Context)

Source from the content-addressed store, hash-verified

47
48// Provision sets up the adminAPI module.
49func (a *adminAPI) Provision(ctx caddy.Context) error {
50 a.ctx = ctx
51 a.log = ctx.Logger(a) // TODO: passing in 'a' is a hack until the admin API is officially extensible (see #5032)
52
53 // Avoid initializing PKI if it wasn't configured.
54 // We intentionally ignore the error since it's not
55 // fatal if the PKI app is not explicitly configured.
56 pkiApp, err := ctx.AppIfConfigured("pki")
57 if err == nil {
58 a.pkiApp = pkiApp.(*PKI)
59 }
60
61 return nil
62}
63
64// Routes returns the admin routes for the PKI app.
65func (a *adminAPI) Routes() []caddy.AdminRoute {

Callers

nothing calls this directly

Calls 2

AppIfConfiguredMethod · 0.80
LoggerMethod · 0.45

Tested by

no test coverage detected