durbun_core library
Pure-Dart core of the Dürbün SDK (no Flutter imports): transport, wire
protocol, logger, mock engine and the dart:io HTTP capture. Usable from
command-line Dart programs (dart run) and from other HTTP adapters.
Flutter apps should use package:durbun/durbun.dart instead.
Classes
- DurbunAction
-
A custom control shown for this app on the desktop (Device tab → app
tools). The desktop invokes it through the
commandscapability. - DurbunActionOption
- One choice of a DurbunAction.select action.
- DurbunClient
-
The SDK's connection to the Dürbün desktop for pure Dart programs (no
Flutter): logs, events, dart:io HTTP capture, mock rules and commands.
Flutter apps use
Durbun.run/Durbun.init, which create one of these. - DurbunConnection
- State of the connection to the Dürbün desktop.
- DurbunHttpClient
- Wraps a dart:io HttpClient (the real one or whatever a previous HttpOverrides produced): every member is forwarded, requests are reported, mock rules are applied.
- DurbunHttpOverrides
-
Installs DurbunHttpClient for every dart:io
HttpClient()created on this isolate, chaining whatever overrides were there before. - DurbunHttpTuning
- Tuning knobs (exposed for tests).
- DurbunOptions
- Configuration of the Dürbün SDK.
- HttpCaptureHost
- Recorder plus an internal zone for timers (provided by the SDK client).
- MockAction
-
MockAction(flattened union; type isrespond,delayorfail). - MockRule
-
MockRule. - NetworkRecorder
- What the dart:io HTTP wrapper needs from the SDK client.
- PendingBody
-
A captured body whose wire form (
WireBody: UTF-8 vs base64, gzip/deflate decoding, truncation) is produced by the transport encoder, off the UI isolate when the background transport is used. - SdkConfig
-
SdkConfigpushed by the desktop inwelcomeandconfigmessages. - ServerWelcome
-
ServerWelcome: the desktop's answer to the SDK's hello. - StreamCaptureHost
-
What stream capture (WebSocket messages, Server-Sent Events) needs from
the SDK, next to
NetworkRecorder. A recorder that does not implement it gets no stream messages (and SSE responses are reported like any other).
Enums
- DurbunActionKind
- Kind of an app action shown on the desktop and in the panel's App tools.
- DurbunLogLevel
-
Log levels, identical to the desktop's
LogLevel. - DurbunPrintCapture
-
How
print/debugPrintoutput is captured.
Constants
- kDefaultSdkPort → const int
-
DEFAULT_PORTS. - kProtocolVersion → const int
-
PROTOCOL_VERSION. - kSdkName → const String
-
SDK identity sent in
hello.sdk. - kSdkVersion → const String
-
This package's version, sent in
hello.sdknext to kSdkName.
Functions
-
findMockRule(
List< MockRule> rules, String method, String url, [String? appId]) → MockRule? -
First enabled matching rule (rules are ordered; first match wins). Rules
with conditions are checked without a body, see
findMockRuleForRequest. -
mockRuleMatches(
MockRule rule, String method, String url, [String? appId]) → bool - Reference matcher (identical semantics in every SDK):
Typedefs
-
DurbunCommandHandler
= FutureOr<
Object?> Function(Map<String, Object?> params) - Runs a desktop command (a DurbunAction or a built-in tool) with its parameters; the result goes back to the desktop.