Compare commits
2 Commits
2db4afc226
...
9258bb8146
| Author | SHA1 | Date |
|---|---|---|
|
|
9258bb8146 | |
|
|
6b578a80cd |
|
|
@ -1,7 +1,6 @@
|
||||||
module docker
|
module docker
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import net.http
|
|
||||||
import types { ContainerListItem }
|
import types { ContainerListItem }
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
|
||||||
9
images.v
9
images.v
|
|
@ -1,6 +1,5 @@
|
||||||
module docker
|
module docker
|
||||||
|
|
||||||
import net.http
|
|
||||||
import types { Image }
|
import types { Image }
|
||||||
|
|
||||||
pub fn (mut d DockerConn) image_inspect(image string) !Image {
|
pub fn (mut d DockerConn) image_inspect(image string) !Image {
|
||||||
|
|
@ -12,8 +11,8 @@ pub fn (mut d DockerConn) image_inspect(image string) !Image {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
// pull_image pulls the given image:tag.
|
// image_pull pulls the given image:tag.
|
||||||
pub fn (mut d DockerConn) pull_image(image string, tag string) ! {
|
pub fn (mut d DockerConn) image_pull(image string, tag string) ! {
|
||||||
d.request(.post, '/images/create', {
|
d.request(.post, '/images/create', {
|
||||||
'fromImage': image
|
'fromImage': image
|
||||||
'tag': tag
|
'tag': tag
|
||||||
|
|
@ -33,7 +32,7 @@ pub fn (mut d DockerConn) pull_image(image string, tag string) ! {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create_image_from_container creates a new image from a container.
|
// create_image_from_container creates a new image from a container.
|
||||||
pub fn (mut d DockerConn) create_image_from_container(id string, repo string, tag string) !Image {
|
pub fn (mut d DockerConn) image_from_container(id string, repo string, tag string) !Image {
|
||||||
d.request(.post, '/commit', {
|
d.request(.post, '/commit', {
|
||||||
'container': id
|
'container': id
|
||||||
'repo': repo
|
'repo': repo
|
||||||
|
|
@ -45,7 +44,7 @@ pub fn (mut d DockerConn) create_image_from_container(id string, repo string, ta
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove_image removes the image with the given id.
|
// remove_image removes the image with the given id.
|
||||||
pub fn (mut d DockerConn) remove_image(id string) ! {
|
pub fn (mut d DockerConn) image_remove(id string) ! {
|
||||||
d.request(.delete, '/images/$id', {})
|
d.request(.delete, '/images/$id', {})
|
||||||
d.send()!
|
d.send()!
|
||||||
d.read_response()!
|
d.read_response()!
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
module types
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
pub struct UsageData {
|
||||||
|
size int [json: Size]
|
||||||
|
ref_count int [json: RefCount]
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Volume {
|
||||||
|
pub mut:
|
||||||
|
created_at_str string [json: CreatedAt]
|
||||||
|
created_at time.Time [skip]
|
||||||
|
name string [json: Name]
|
||||||
|
driver string [json: Driver]
|
||||||
|
mountpoint string [json: Mountpoint]
|
||||||
|
status map[string]string [json: Status]
|
||||||
|
labels map[string]string [json: Labels]
|
||||||
|
scope string [json: Scope]
|
||||||
|
options map[string]string [json: Options]
|
||||||
|
usage_data UsageData [json: UsageData]
|
||||||
|
}
|
||||||
21
volumes.v
21
volumes.v
|
|
@ -1,26 +1,7 @@
|
||||||
module docker
|
module docker
|
||||||
|
|
||||||
import net.http
|
|
||||||
import time
|
import time
|
||||||
|
import types { Volume }
|
||||||
struct UsageData {
|
|
||||||
size int [json: Size]
|
|
||||||
ref_count int [json: RefCount]
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Volume {
|
|
||||||
created_at_str string [json: CreatedAt]
|
|
||||||
pub mut:
|
|
||||||
created_at time.Time [skip]
|
|
||||||
name string [json: Name]
|
|
||||||
driver string [json: Driver]
|
|
||||||
mountpoint string [json: Mountpoint]
|
|
||||||
status map[string]string [json: Status]
|
|
||||||
labels map[string]string [json: Labels]
|
|
||||||
scope string [json: Scope]
|
|
||||||
options map[string]string [json: Options]
|
|
||||||
usage_data UsageData [json: UsageData]
|
|
||||||
}
|
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
pub struct VolumeListFilter {
|
pub struct VolumeListFilter {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue