vieter/src/docker/containers.v

16 lines
235 B
Coq
Raw Normal View History

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