extensiondiagnostics

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package extensiondiagnostics brokers fresh, read-only frontend diagnostics.

Index

Constants

View Source
const MaxPayloadBytes = 1 << 20
View Source
const MaxPending = 16
View Source
const MaxRuntimes = 64
View Source
const MaxTimeout = 30 * time.Second
View Source
const RequestEvent = "extensions/diagnostics/request"

Variables

View Source
var (
	ErrUnavailable = errors.New("extension diagnostics runtime is unavailable")
	ErrCapacity    = errors.New("extension diagnostics request capacity reached")
	ErrResponse    = errors.New("invalid, expired, or duplicate extension diagnostics response")
	ErrWindow      = errors.New("extension diagnostics response window does not match")
	ErrParams      = errors.New("invalid extension diagnostics request")
	ErrRuntime     = errors.New("extension diagnostics runtime could not complete the request")
	ErrUnsupported = errors.New("extension context lookup supports only built-in sidebar and drawer points")
)

Functions

func ValidRequest

func ValidRequest(window, operation string, options Options) bool

Types

type Broker

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

Broker never retains snapshots. Every query requires a new frontend response.

func NewBroker

func NewBroker() *Broker

func (*Broker) Close

func (b *Broker) Close()

Close disconnects the host transport and releases all pending queries.

func (*Broker) Query

func (b *Broker) Query(ctx context.Context, window, operation string, options Options) (json.RawMessage, error)

func (*Broker) RegisterRuntime

func (b *Broker) RegisterRuntime(window string, alive func() bool) (Registration, error)

RegisterRuntime leases an identity authenticated by the trusted host adapter. The liveness check must identify that same native window or browser client.

func (*Broker) Respond

func (b *Broker) Respond(id, window, payload, errorMessage string) error

Respond consumes a valid correlation exactly once. The trusted host adapter must authenticate the caller's window before forwarding a response. Rejected responses cannot consume another window's request or revive a cancelled request.

func (*Broker) Start

func (b *Broker) Start(emit func(Request) error)

Start attaches the trusted host transport for fresh diagnostic requests.

func (*Broker) UnregisterRuntime

func (b *Broker) UnregisterRuntime(window, token string)

UnregisterRuntime releases only the matching host-issued registration lease.

func (*Broker) Windows

func (b *Broker) Windows(ctx context.Context) ([]RuntimeInfo, error)

Windows lists runtime registrations, never cached registry snapshots.

type Options

type Options struct {
	IncludeSensitive bool   `json:"includeSensitive,omitempty"`
	PluginID         string `json:"pluginId,omitempty"`
	PointID          string `json:"pointId,omitempty"`
	IssuesOnly       bool   `json:"issuesOnly,omitempty"`
	Query            string `json:"query,omitempty"`
	ResourceKey      string `json:"resourceKey,omitempty"`
}

type Registration

type Registration struct {
	WindowName string `json:"windowName"`
	Token      string `json:"token"`
	Pending    bool   `json:"pending,omitempty"`
}

type Request

type Request struct {
	RequestID  string  `json:"requestId"`
	WindowName string  `json:"windowName"`
	Operation  string  `json:"operation"`
	Options    Options `json:"options"`
}

type RuntimeInfo

type RuntimeInfo struct {
	WindowName   string    `json:"windowName"`
	RegisteredAt time.Time `json:"registeredAt"`
	LastSeen     time.Time `json:"lastSeen"`
}

Directories

Path Synopsis
Package host adapts the pure diagnostics broker to authenticated Wails callers.
Package host adapts the pure diagnostics broker to authenticated Wails callers.

Jump to

Keyboard shortcuts

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