Documentation
¶
Overview ¶
Package extensiondiagnostics brokers fresh, read-only frontend diagnostics.
Index ¶
- Constants
- Variables
- func ValidRequest(window, operation string, options Options) bool
- type Broker
- func (b *Broker) Close()
- func (b *Broker) Query(ctx context.Context, window, operation string, options Options) (json.RawMessage, error)
- func (b *Broker) RegisterRuntime(window string, alive func() bool) (Registration, error)
- func (b *Broker) Respond(id, window, payload, errorMessage string) error
- func (b *Broker) Start(emit func(Request) error)
- func (b *Broker) UnregisterRuntime(window, token string)
- func (b *Broker) Windows(ctx context.Context) ([]RuntimeInfo, error)
- type Options
- type Registration
- type Request
- type RuntimeInfo
Constants ¶
const MaxPayloadBytes = 1 << 20
const MaxPending = 16
const MaxRuntimes = 64
const MaxTimeout = 30 * time.Second
const RequestEvent = "extensions/diagnostics/request"
Variables ¶
var ( 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 ¶
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker never retains snapshots. Every query requires a new frontend response.
func (*Broker) Close ¶
func (b *Broker) Close()
Close disconnects the host transport and releases all pending queries.
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 ¶
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) UnregisterRuntime ¶
UnregisterRuntime releases only the matching host-issued registration lease.
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"`
}