vieter/src/docker/containers.v

16 lines
262 B
Coq
Raw Normal View History

module docker
import json
import net.urllib
struct Container {
2022-02-20 13:10:48 +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 {}
}