ISpectWSInterceptor class final
WebSocket interceptor that logs events via the trace API.
Constructors
- ISpectWSInterceptor({required ISpectLogger logger, ISpectWSInterceptorSettings settings = const ISpectWSInterceptorSettings(), void onClientReady(WebSocketClient)?, RedactionService? redactor})
Properties
- enableRedaction → bool
-
Whether redaction is enabled for this interceptor.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → ISpectLogger
-
The logger instance for network logging.
no setter
- onClientReady → void Function(WebSocketClient)?
-
final
- redactor → RedactionService
-
The redaction service for this interceptor.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → ISpectWSInterceptorSettings
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onMessage(
Object data, void next(Object data)) → void - Called when the message is about to be received.
-
onSend(
Object data, void next(Object data)) → void - Called when the message is about to be sent.
-
processMapData(
Map data, {required bool useRedaction}) → Map< String, dynamic> -
Processes and redacts a map, ensuring string keys.
inherited
-
redactUrl(
String url, {required bool useRedaction}) → String -
Redacts query parameter values and userInfo credentials in a URL.
inherited
-
redactUrlAndPath(
Uri uri, {required bool useRedaction}) → ({String path, String url}) -
Redacts both URL and path from a Uri in one call.
inherited
-
safeRedact(
Object data, {required bool useRedaction}) → Object -
Applies redaction with error handling: logs a warning and returns
a placeholder on failure instead of propagating the exception.
inherited
-
setClient(
WebSocketClient client) → void -
shouldProcess<
T> ({required bool enabled, required bool filter(T)?, required T value}) → bool -
Returns
truewhen the interceptor isenabledand the optionalfiltereither isnullor returnstrueforvalue.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited