Skip to main content

Type Alias: WebSocketConnectionRequest<T>

type WebSocketConnectionRequest<T>: object;

Configuration for establishing a WebSocket connection to watch Kubernetes resources. Used by the multiplexer to manage multiple WebSocket connections efficiently.

Type Parameters

Type ParameterDescription
TThe expected type of data that will be received over the WebSocket

Type declaration

cluster

cluster: string;

The Kubernetes cluster identifier to connect to. Used for routing WebSocket messages in multi-cluster environments.

onMessage()

onMessage: (data: T) => void;

Callback function that handles incoming messages from the WebSocket.

Parameters

ParameterTypeDescription
dataTThe message payload, typed as T (e.g., K8s Pod, Service, etc.)

Returns

void

url

url: string;

The WebSocket endpoint URL to connect to. Should be a full URL including protocol and any query parameters. Example: 'https://cluster.example.com/api/v1/pods/watch'

Defined in

src/lib/k8s/api/v2/webSocket.ts:379