generated from bool64/go-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.go
33 lines (23 loc) · 1.04 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package debug
import (
"context"
"github.com/go-chi/chi/v5"
)
// Config keeps debug settings.
type Config struct {
// TraceSamplingProbability is probability of exporting of OpenCensus trace.
TraceSamplingProbability float64 `split_words:"true" default:"0.1"`
// TraceURL allows providing URL to {trace_id}, example http://jaeger.myservice.com/trace/{trace_id}.
TraceURL string `split_words:"true"`
// DevTools enables developer tools for documentation and debug.
DevTools bool `split_words:"true" default:"true"`
// DevPassword enables password protection for dev tools.
DevPassword string `split_words:"true"`
// URL used as an entry point to mount dev tools debug router.
URL string `split_words:"true" default:"/debug"`
// ExposePanic allows showing panic messages and traces in API response,
// can be useful for non-production environments.
ExposePanic bool `split_words:"true"`
OnPanic []func(ctx context.Context, rcv interface{}, stack []byte) `json:"-" ignored:"true"`
Middlewares chi.Middlewares `envconfig:"-" json:"-"`
}