vieter/src/docker/containers.v

16 lines
266 B
Coq
Raw Normal View History

module docker
import json
import net.urllib
struct Container {
2022-02-19 22:25:52 +01:00
id string [json: Id]
names []string [json: Names]
}
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 {}
}