MCPcopy Index your code
hub / github.com/tailscale/tailscale / ExampleDebugHandler_KVFunc

Function ExampleDebugHandler_KVFunc

tsweb/debug_test.go:181–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179}
180
181func ExampleDebugHandler_KVFunc() {
182 mux := http.NewServeMux()
183 dbg := Debugger(mux)
184 // Adds an count of page renders to /debug/. Note this example
185 // isn't concurrency-safe.
186 views := 0
187 dbg.KVFunc("Debug pageviews", func() any {
188 views = views + 1
189 return views
190 })
191 dbg.KV("Donuts", 42)
192}
193
194func ExampleDebugHandler_URL() {
195 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 3

KVFuncMethod · 0.80
KVMethod · 0.80
DebuggerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…