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

Method emitEvent

context.go:290–295  ·  view source on GitHub ↗

emitEvent is a small convenience method so the caddy core can emit events, if the event app is configured.

(name string, data map[string]any)

Source from the content-addressed store, hash-verified

288
289// emitEvent is a small convenience method so the caddy core can emit events, if the event app is configured.
290func (ctx Context) emitEvent(name string, data map[string]any) Event {
291 if ctx.cfg == nil || ctx.cfg.eventEmitter == nil {
292 return Event{}
293 }
294 return ctx.cfg.eventEmitter.Emit(ctx, name, data)
295}
296
297// loadModulesFromSomeMap loads modules from val, which must be a type of map[string]any.
298// Depending on inlineModuleKey, it will be interpreted as either a ModuleMap (key is the module

Callers 2

runFunction · 0.80
unsyncedStopFunction · 0.80

Calls 1

EmitMethod · 0.65

Tested by

no test coverage detected