From 9258bb81465fc09dbe434dd0341a287b1aa2e94d Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Thu, 5 Jan 2023 13:11:41 +0100 Subject: [PATCH] refactor: moving some stuff --- containers.v | 1 - images.v | 1 - types/volume.v | 22 ++++++++++++++++++++++ volumes.v | 21 +-------------------- 4 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 types/volume.v diff --git a/containers.v b/containers.v index 14d295f..545cce1 100644 --- a/containers.v +++ b/containers.v @@ -1,7 +1,6 @@ module docker import time -import net.http import types { ContainerListItem } [params] diff --git a/images.v b/images.v index 15b6861..ec328bd 100644 --- a/images.v +++ b/images.v @@ -1,6 +1,5 @@ module docker -import net.http import types { Image } pub fn (mut d DockerConn) image_inspect(image string) !Image { diff --git a/types/volume.v b/types/volume.v new file mode 100644 index 0000000..14bc012 --- /dev/null +++ b/types/volume.v @@ -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] +} diff --git a/volumes.v b/volumes.v index 6ce9905..8442ef0 100644 --- a/volumes.v +++ b/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 {