Zuraffa class
Global configuration and utilities for Zuraffa.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- disableCache ↔ bool
-
Returns true if caching is globally disabled.
getter/setter pair
- enableApiInProfile ↔ bool
-
Whether the API bridge is active in profile mode.
getter/setter pair
- environment → Environment
-
Get the current application environment.
no setter
- hooksEnabled ← bool
-
Enable/disable all hooks globally.
no getter
- interceptorRegistry → InterceptorRegistry
-
Global interceptor registry for UseCase pipelines.
final
- isDebugMode → bool
-
Returns true if the application is running in debug mode.
no setter
Static Methods
-
addFailureReporter(
FailureReporter reporter, {ReportRetryPolicy? retryPolicy, int? maxQueueSize, int? maxBatchSize, Duration? flushInterval, bool persistFailures = false}) → Future< void> - Register a failure reporter.
-
clearInterceptors(
) → void - Clear all registered interceptors.
-
disableLogging(
) → void - Disable logging.
-
disposeFailureHooks(
) → void - Dispose all artifact and failure hooks.
-
disposeFailureReporters(
) → Future< void> - Dispose all failure reporters and flush pending reports.
-
enableLogging(
{ZuraffaLogLevel level = ZuraffaLogLevel.all, void onRecord(LogRecord record)?}) → void - Enable debug logging for the framework.
-
enableMinIOArtifacts(
{required String endpoint, required String accessKey, required String secretKey, required String bucket, String region = 'us-east-1', bool ensureBucketExists = false, String? pathPrefix, bool includeReasonInKey = true, bool includeSourceInKey = true, Map< String, String> extensionOverrides = const {}}) → void - Convenience: set up MinIO artifact storage in one call.
-
enableMinIOFailureArtifacts(
{required String endpoint, required String accessKey, required String secretKey, required String bucket, String region = 'us-east-1', bool ensureBucketExists = false, String? pathPrefix, String htmlContentType = 'text/html; charset=utf-8'}) → void - Convenience: set up MinIO artifact uploads for scrape failures.
-
enableOtelReporting(
{required Uri collectorEndpoint, required String serviceName, String? apiKey, ReportRetryPolicy? retryPolicy, int? maxQueueSize, Duration? flushInterval, bool persistFailures = false, bool exportLogs = false, ZuraffaLogLevel remoteLogLevel = ZuraffaLogLevel.warning}) → Future< void> - Convenience: set up OpenTelemetry failure reporting in one call.
-
flushFailureReports(
) → Future< void> - Flush all pending failure reports.
-
publishArtifact(
dynamic data, {required String id, required String contentType, required String reason, String? source, String? label, Map< String, dynamic> metadata = const {}, StackTrace? stackTrace, List<String> pathSegments = const [], String? traceId, String? spanId}) → void - Publish an artifact to all registered hooks (fire-and-forget).
-
publishArtifactAwaited(
dynamic data, {required String id, required String contentType, required String reason, String? source, String? label, Map< String, dynamic> metadata = const {}, StackTrace? stackTrace, List<String> pathSegments = const [], String? traceId, String? spanId}) → Future<void> - Publish an artifact to all registered hooks (awaited).
-
registerArtifactHook(
ArtifactHook hook) → void - Register an artifact hook that reacts to published artifacts.
-
registerFailureHook(
FailureHook hook) → void - Register a failure hook that reacts to errors.
-
registerHook(
Hook hook) → void - Register a generic hook.
-
registerInterceptor<
In, Out> (InterceptorEntry< In, Out> entry) → void -
Register a UseCase interceptor for input type
Inand output typeOut. -
removeFailureReporter(
String id) → Future< void> - Remove a failure reporter by ID.
-
setEnvironment(
Environment env, {bool? isDebugMode, ZuraffaLogLevel logLevel = ZuraffaLogLevel.all}) → void - Set the application environment and debug mode.
-
toLevel(
ZuraffaLogLevel level) → Level -
unregisterArtifactHook(
String id) → void -
Unregister an artifact hook by its
id. -
unregisterFailureHook(
String id) → void -
Unregister a failure hook by its
id. -
unregisterHook(
String id) → void - Unregister a hook by ID.