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

Method KVFunc

tsweb/debug.go:146–151  ·  view source on GitHub ↗

KVFunc adds a key/value list item to /debug/. v is called on every render of /debug/.

(k string, v func() any)

Source from the content-addressed store, hash-verified

144// KVFunc adds a key/value list item to /debug/. v is called on every
145// render of /debug/.
146func (d *DebugHandler) KVFunc(k string, v func() any) {
147 d.kvs = append(d.kvs, func(w io.Writer) {
148 val := html.EscapeString(fmt.Sprintf("%v", v()))
149 fmt.Fprintf(w, "<li><b>%s:</b> %s</li>", k, val)
150 })
151}
152
153// URL adds a URL and description list item to /debug/.
154func (d *DebugHandler) URL(url, desc string) {

Callers 4

DebuggerFunction · 0.95
TestDebuggerKVFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestDebuggerKVFunction · 0.64