Files
PeachDeployments/lib/Peach/see/kafka/ConnectKafka.dart
alvocool 38881d1fe1 Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:15:30 +03:00

37 lines
1021 B
Dart

import '../../about/external/data/Kafka.dart';
/// One scan's worth of cluster state.
class KafkaScan {
final List<KafkaTopic> topics;
final List<KafkaConsumerGroup> groups;
final KafkaCluster cluster;
const KafkaScan({
required this.topics,
required this.groups,
required this.cluster,
});
/// Nothing came back at all — usually an unreachable bootstrap server rather
/// than a genuinely empty cluster.
bool get isEmpty =>
topics.isEmpty && groups.isEmpty && cluster.brokers.isEmpty;
}
abstract class ConnectKafka {
/// Whether the Kafka CLI tools were found, and where.
void onKafkaDetected(KafkaStatus status);
/// Detection itself failed (the server couldn't be probed).
void onDetectFailed(String message);
/// Topics, groups and cluster health, freshly read.
void onScanned(KafkaScan scan);
/// The scan failed.
void onScanFailed(String message);
/// Output of the broker probe, to show in a sheet.
void onProbeOutput(String title, String output);
}