MCPcopy Create free account
hub / github.com/buggregator/server / Module

Interface Module

internal/module/module.go:14–43  ·  view source on GitHub ↗

Module is the interface every event module must implement. Embed BaseModule to get no-op defaults for optional methods.

Source from the content-addressed store, hash-verified

12// Module is the interface every event module must implement.
13// Embed BaseModule to get no-op defaults for optional methods.
14type Module interface {
15 // Name returns a human-readable module name (e.g., "Sentry").
16 Name() string
17
18 // Type returns the event type string stored in the events table.
19 Type() string
20
21 // RegisterRoutes adds module-specific API routes to the router.
22 RegisterRoutes(mux *http.ServeMux, store event.Store)
23
24 // HTTPHandler returns a handler that inspects an incoming request
25 // and either claims it or returns nil. Return nil if this module
26 // has no HTTP ingestion (e.g., TCP-only modules).
27 HTTPHandler() HTTPIngestionHandler
28
29 // TCPServers returns TCP server configurations this module needs.
30 TCPServers() []tcp.ServerConfig
31
32 // PreviewMapper returns the mapper for converting payloads to previews.
33 PreviewMapper() event.PreviewMapper
34
35 // RegisterMigrations registers module-specific SQL migration files.
36 RegisterMigrations(migrator *storage.Migrator) error
37
38 // OnInit is called once at startup after migrations are applied.
39 OnInit(db *sql.DB) error
40
41 // OnEventStored is called after any event is persisted.
42 OnEventStored(ev event.Event)
43}
44
45// HTTPIngestionHandler decides if an HTTP request belongs to a module.
46type HTTPIngestionHandler interface {

Callers 23

TestModule_NameAndTypeFunction · 0.65
StartPHPProcessFunction · 0.65
InitMethod · 0.65
AddFromFSMethod · 0.65
TestModule_NameAndTypeFunction · 0.65
InitMethod · 0.65
setupAPITestFunction · 0.65
InitMethod · 0.65
InitMethod · 0.65
InitMethod · 0.65
RunMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected