new: podman

This commit is contained in:
lollipopkit
2024-01-21 15:12:43 +08:00
parent 7156f08eb8
commit 50bcabbc54
36 changed files with 1097 additions and 795 deletions

View File

@@ -0,0 +1,30 @@
import 'package:toolbox/data/model/container/type.dart';
import '../../core/persistant_store.dart';
const _keyConfig = 'providerConfig';
class DockerStore extends PersistentStore {
DockerStore() : super('docker');
String? fetch(String? id) {
return box.get(id);
}
void put(String id, String host) {
box.put(id, host);
}
ContainerType getType([String? id]) {
final cfg = box.get(_keyConfig + (id ?? ''));
if (cfg == null) {
return ContainerType.docker;
} else {
return ContainerType.values.firstWhere((e) => e.toString() == cfg);
}
}
void setType(String? id, ContainerType type) {
box.put(_keyConfig + (id ?? ''), type.toString());
}
}