SlaveInfo.fromMap constructor

SlaveInfo.fromMap(
  1. Map<String, String> map,
  2. int index
)

Implementation

factory SlaveInfo.fromMap(Map<String, String> map, int index) {
  return SlaveInfo(
    ip: map['slave${index}_ip'] ?? '',
    port: int.parse(map['slave${index}_port'] ?? '0'),
    state: map['slave${index}_state'] ?? '',
    offset: int.parse(map['slave${index}_offset'] ?? '0'),
    lag: int.parse(map['slave${index}_lag'] ?? '0'),
  );
}