Compare commits
2 Commits
2db4afc226
...
9258bb8146
| Author | SHA1 | Date |
|---|---|---|
|
|
9258bb8146 | |
|
|
6b578a80cd |
|
|
@ -1,7 +1,6 @@
|
|||
module docker
|
||||
|
||||
import time
|
||||
import net.http
|
||||
import types { ContainerListItem }
|
||||
|
||||
[params]
|
||||
|
|
|
|||
9
images.v
9
images.v
|
|
@ -1,6 +1,5 @@
|
|||
module docker
|
||||
|
||||
import net.http
|
||||
import types { 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
|
||||
}
|
||||
|
||||
// pull_image pulls the given image:tag.
|
||||
pub fn (mut d DockerConn) pull_image(image string, tag string) ! {
|
||||
// image_pull pulls the given image:tag.
|
||||
pub fn (mut d DockerConn) image_pull(image string, tag string) ! {
|
||||
d.request(.post, '/images/create', {
|
||||
'fromImage': image
|
||||
'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.
|
||||
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', {
|
||||
'container': id
|
||||
'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.
|
||||
pub fn (mut d DockerConn) remove_image(id string) ! {
|
||||
pub fn (mut d DockerConn) image_remove(id string) ! {
|
||||
d.request(.delete, '/images/$id', {})
|
||||
d.send()!
|
||||
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
|
||||
|
||||
import net.http
|
||||
import time
|
||||
|
||||
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]
|
||||
}
|
||||
import types { Volume }
|
||||
|
||||
[params]
|
||||
pub struct VolumeListFilter {
|
||||
|
|
|
|||
Loading…
Reference in New Issue