App implements a global eventing system within Caddy. Modules can emit and subscribe to events, providing hooks into deep parts of the code base that aren't otherwise accessible. Events provide information about what and when things are happening, and this facility allows handlers to take action whe
| 70 | // The entirety of this app module is EXPERIMENTAL and |
| 71 | // subject to change. Pay attention to release notes. |
| 72 | type App struct { |
| 73 | // Subscriptions bind handlers to one or more events |
| 74 | // either globally or scoped to specific modules or module |
| 75 | // namespaces. |
| 76 | Subscriptions []*Subscription `json:"subscriptions,omitempty"` |
| 77 | |
| 78 | // Map of event name to map of module ID/namespace to handlers |
| 79 | subscriptions map[string]map[caddy.ModuleID][]Handler |
| 80 | |
| 81 | logger *zap.Logger |
| 82 | started bool |
| 83 | } |
| 84 | |
| 85 | // Subscription represents binding of one or more handlers to |
| 86 | // one or more events. |
nothing calls this directly
no outgoing calls
no test coverage detected