webug

package
v0.0.0-...-7ea9ef1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package webug implements a web-based debug/troubleshooting/introspection system for the BMDB. It's optimized for use by developers and trained operators, prioritizing information density, fast navigation and heavy interlinking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, conn *bmdb.Connection, mux *http.ServeMux, enableStrictConsistency bool) error

Register webug on an HTTP mux, using a BMDB connection pool.

The given context will be used not only to time out the registration call, but also used to run a BMDB schema fetching goroutine that will attempt to fetch newer versions of the schema every hour.

This is a low-level function useful when tying webug into an existing web application. If you just want to run webug on a separate port that's configured by flags, use Config and Config.RegisterFlags.

Types

type Config

type Config struct {
	// If set, start a webug interface on an HTTP listener bound to the given address.
	WebugListenAddress string

	// Enables strict consistency
	WebugDBFetchStrict bool
}

Config describes the webug interface configuration. This should be embedded inside your component's Config object.

To configure, either set values or call RegisterFlags before flag.Parse.

To run after configuration, call Start.

func (*Config) RegisterFlags

func (c *Config) RegisterFlags()

RegisterFlags for webug interface.

func (*Config) Start

func (c *Config) Start(ctx context.Context, conn *bmdb.Connection) error

Start the webug interface in the foreground if enabled. The returned error will be either a configuration/connection error returned as soon as possible, or a context expiration error.

The given context will be used for all connections from the webug interface to the given BMDB connection.

Jump to

Keyboard shortcuts

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