debug

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanelsForEventType

func PanelsForEventType(eventType string) []string

PanelsForEventType returns panel IDs that subscribe to an event type.

func RegisterPanel

func RegisterPanel(id string, config PanelConfig) error

RegisterPanel registers a panel in the default registry.

func RegistryVersion

func RegistryVersion() string

RegistryVersion returns the default registry version identifier.

func SetRegistryVersion

func SetRegistryVersion(version string)

SetRegistryVersion sets a version identifier for the default registry.

func UnregisterPanel

func UnregisterPanel(id string)

UnregisterPanel removes a panel from the default registry.

Types

type PanelClearFunc

type PanelClearFunc func(ctx context.Context) error

PanelClearFunc clears panel state when requested by the client.

type PanelConfig

type PanelConfig struct {
	Label           string
	Icon            string
	Span            int
	SnapshotKey     string
	EventType       string
	EventTypes      []string
	Snapshot        PanelSnapshotFunc
	Clear           PanelClearFunc
	SupportsToolbar *bool
	Category        string
	Order           int
	Version         string
	Metadata        map[string]any
}

PanelConfig configures a server-side debug panel registration.

type PanelDefinition

type PanelDefinition struct {
	ID              string         `json:"id"`
	Label           string         `json:"label"`
	Icon            string         `json:"icon,omitempty"`
	Span            int            `json:"span,omitempty"`
	SnapshotKey     string         `json:"snapshot_key"`
	EventTypes      []string       `json:"event_types,omitempty"`
	SupportsToolbar bool           `json:"supports_toolbar"`
	Category        string         `json:"category,omitempty"`
	Order           int            `json:"order,omitempty"`
	Version         string         `json:"version,omitempty"`
	Metadata        map[string]any `json:"metadata,omitempty"`
}

PanelDefinition describes a registered panel for client discovery.

func PanelDefinitionFor

func PanelDefinitionFor(id string) (PanelDefinition, bool)

PanelDefinitionFor retrieves panel metadata from the default registry.

func PanelDefinitions

func PanelDefinitions() []PanelDefinition

PanelDefinitions returns definitions for all registered panels.

type PanelRegistration

type PanelRegistration struct {
	Definition PanelDefinition
	Snapshot   PanelSnapshotFunc
	Clear      PanelClearFunc
}

PanelRegistration stores definition metadata and server hooks.

func Panel

func Panel(id string) (PanelRegistration, bool)

Panel retrieves a registered panel from the default registry.

func PanelRegistrations

func PanelRegistrations() []PanelRegistration

PanelRegistrations returns all registered panels with hooks.

type PanelRegistry

type PanelRegistry struct {
	// contains filtered or unexported fields
}

PanelRegistry stores registered panels and metadata.

func NewPanelRegistry

func NewPanelRegistry() *PanelRegistry

NewPanelRegistry creates an empty panel registry.

func (*PanelRegistry) Definitions

func (r *PanelRegistry) Definitions() []PanelDefinition

Definitions returns a sorted list of registered panel definitions.

func (*PanelRegistry) PanelsForEventType

func (r *PanelRegistry) PanelsForEventType(eventType string) []string

PanelsForEventType returns panel IDs that subscribe to an event type.

func (*PanelRegistry) Register

func (r *PanelRegistry) Register(id string, config PanelConfig) error

Register registers a panel in the registry.

func (*PanelRegistry) Registration

func (r *PanelRegistry) Registration(id string) (PanelRegistration, bool)

Registration returns a panel registration by ID.

func (*PanelRegistry) Registrations

func (r *PanelRegistry) Registrations() []PanelRegistration

Registrations returns a sorted list of panel registrations.

func (*PanelRegistry) SetVersion

func (r *PanelRegistry) SetVersion(version string)

SetVersion updates the registry version identifier.

func (*PanelRegistry) Unregister

func (r *PanelRegistry) Unregister(id string)

Unregister removes a panel from the registry.

func (*PanelRegistry) Version

func (r *PanelRegistry) Version() string

Version returns the registry version identifier.

type PanelSnapshotFunc

type PanelSnapshotFunc func(ctx context.Context) any

PanelSnapshotFunc returns snapshot payloads for a panel.

Jump to

Keyboard shortcuts

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