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

Function StdHandler

tsweb/tsweb.go:464–466  ·  view source on GitHub ↗

StdHandler converts a ReturnHandler into a standard http.Handler. Handled requests are logged using opts.Logf, as are any errors. Errors are handled as specified by the ReturnHandler interface. Short-hand for LogHandler(ErrorHandler()).

(h ReturnHandler, opts HandlerOptions)

Source from the content-addressed store, hash-verified

462// Errors are handled as specified by the ReturnHandler interface.
463// Short-hand for LogHandler(ErrorHandler()).
464func StdHandler(h ReturnHandler, opts HandlerOptions) http.Handler {
465 return LogHandler(ErrorHandler(h, opts.errorOptions()), opts.logOptions())
466}
467
468// LogHandler returns an http.Handler that logs to opts.Logf.
469// It logs both successful and failing requests.

Callers 12

TestProberRunHandlerFunction · 0.92
TestRunAllHandlerFunction · 0.92
TestExcludeInRunAllFunction · 0.92
mainFunction · 0.92
TestStdHandlerFunction · 0.85
TestStdHandler_PanicFunction · 0.85
TestStdHandler_CanceledFunction · 0.85
BenchmarkLogNot200Function · 0.85
BenchmarkLogFunction · 0.85

Calls 4

LogHandlerFunction · 0.85
ErrorHandlerFunction · 0.85
errorOptionsMethod · 0.80
logOptionsMethod · 0.80

Tested by 11

TestProberRunHandlerFunction · 0.74
TestRunAllHandlerFunction · 0.74
TestExcludeInRunAllFunction · 0.74
TestStdHandlerFunction · 0.68
TestStdHandler_PanicFunction · 0.68
TestStdHandler_CanceledFunction · 0.68
BenchmarkLogNot200Function · 0.68
BenchmarkLogFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…