debug

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package debug provides debug helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvVars

func EnvVars(trimAfter int) map[string]string

EnvVars dumps env vars trimming tail part for security.

Types

type Config

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:"-"`
}

Config keeps debug settings.

type Mux added in v0.0.4

type Mux struct {
	*chi.Mux
	Prefix string
	// contains filtered or unexported fields
}

Mux serves debug tools.

func NewMux added in v0.0.4

func NewMux(prefix string) *Mux

NewMux creates a new router for debug tools.

func (r *Mux) AddLink(link, title string)

AddLink adds a link to the index page of debug tools.

Directories

Path Synopsis
Package zpages provides OpenCensus zpages handlers.
Package zpages provides OpenCensus zpages handlers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL