import '../../about/external/data/Kafka.dart'; /// One scan's worth of cluster state. class KafkaScan { final List topics; final List 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); }