Compare commits

..

No commits in common. "9258bb81465fc09dbe434dd0341a287b1aa2e94d" and "2db4afc226d03c8f60976eebf72c8d0a9f5089cc" have entirely different histories.

4 changed files with 26 additions and 27 deletions

View File

@ -1,6 +1,7 @@
module docker
import time
import net.http
import types { ContainerListItem }
[params]

View File

@ -1,5 +1,6 @@
module docker
import net.http
import types { Image }
pub fn (mut d DockerConn) image_inspect(image string) !Image {
@ -11,8 +12,8 @@ pub fn (mut d DockerConn) image_inspect(image string) !Image {
return data
}
// image_pull pulls the given image:tag.
pub fn (mut d DockerConn) image_pull(image string, tag string) ! {
// pull_image pulls the given image:tag.
pub fn (mut d DockerConn) pull_image(image string, tag string) ! {
d.request(.post, '/images/create', {
'fromImage': image
'tag': tag
@ -32,7 +33,7 @@ pub fn (mut d DockerConn) image_pull(image string, tag string) ! {
}
// create_image_from_container creates a new image from a container.
pub fn (mut d DockerConn) image_from_container(id string, repo string, tag string) !Image {
pub fn (mut d DockerConn) create_image_from_container(id string, repo string, tag string) !Image {
d.request(.post, '/commit', {
'container': id
'repo': repo
@ -44,7 +45,7 @@ pub fn (mut d DockerConn) image_from_container(id string, repo string, tag strin
}
// remove_image removes the image with the given id.
pub fn (mut d DockerConn) image_remove(id string) ! {
pub fn (mut d DockerConn) remove_image(id string) ! {
d.request(.delete, '/images/$id', {})
d.send()!
d.read_response()!

View File

@ -1,22 +0,0 @@
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]
}

View File

@ -1,7 +1,26 @@
module docker
import net.http
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]
pub struct VolumeListFilter {