Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
36
lib/Peach/see/kafka/ConnectKafka.dart
Normal file
36
lib/Peach/see/kafka/ConnectKafka.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user