client/local,cmd/tailscale/cli,ipn/localapi: expose eventbus graph (#16597)

Make it possible to dump the eventbus graph as JSON or DOT to both debug
and document what is communicated via the bus.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
Claus Lensbøl
2025-07-18 10:55:17 -04:00
committed by GitHub
parent 93511be044
commit d334d9ba07
4 changed files with 125 additions and 0 deletions

View File

@@ -195,3 +195,16 @@ type DebugEvent struct {
To []string
Event any
}
// DebugTopics provides the JSON encoding as a wrapper for a collection of [DebugTopic].
type DebugTopics struct {
Topics []DebugTopic
}
// DebugTopic provides the JSON encoding of publishers and subscribers for a
// given topic.
type DebugTopic struct {
Name string
Publisher string
Subscribers []string
}