feat: add image_inspect function
parent
598597f726
commit
9aebb3bedc
11
images.v
11
images.v
|
@ -1,11 +1,16 @@
|
|||
module docker
|
||||
|
||||
import net.http { Method }
|
||||
import types { Image }
|
||||
import json
|
||||
|
||||
struct Image {
|
||||
pub:
|
||||
id string [json: Id]
|
||||
pub fn (mut d DockerConn) image_inspect(image string) !Image {
|
||||
d.send_request(.get, '/images/$image/json')!
|
||||
_, body := d.read_response()!
|
||||
|
||||
data := json.decode(Image, body)!
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
// pull_image pulls the given image:tag.
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
module types
|
||||
|
||||
pub struct Image {
|
||||
pub:
|
||||
id string [json: Id]
|
||||
}
|
Loading…
Reference in New Issue