Back to

package debugger

Latest Go to latest
Published: Apr 28, 2020 | License: MIT | Module:


Debugger package allows an application to be compiled for production without incurring any penalty due to instrumentation.

When the time comes to use a debugger and inspect your code, use the -tags=debugger build tag to switch the implementation to one that will set labels that can be displayed in the debugger.

The current implementation relies on pprof labels to be created and then the debugger can read them and display them.


func Middleware

func Middleware(f http.HandlerFunc, l MiddlewareLabels) http.HandlerFunc

Middleware allows HTTP middleware to receive debugger labels

func SetLabels

func SetLabels(l Labels)

SetLabels will set debugger labels for any function/method call

type Labels

type Labels func() []string

Labels generates the labels for a function/method

type MiddlewareLabels

type MiddlewareLabels func(r *http.Request) []string

MiddlewareLabels generates labels that are aware of the request properties

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier