2022-02-17 22:00:46 +01:00
|
|
|
module docker
|
|
|
|
|
|
|
|
import json
|
|
|
|
import net.urllib
|
|
|
|
|
|
|
|
struct Container {
|
2022-02-19 21:41:26 +01:00
|
|
|
id string
|
|
|
|
names []string
|
2022-02-17 22:00:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn containers() ?[]Container {
|
2022-02-19 21:41:26 +01:00
|
|
|
res := get(urllib.parse('/containers/json') ?) ?
|
2022-02-17 22:00:46 +01:00
|
|
|
|
2022-02-19 21:41:26 +01:00
|
|
|
return json.decode([]Container, res.text) or {}
|
2022-02-17 22:00:46 +01:00
|
|
|
}
|