From a0d0af4538949d69a40cab69d4735ebc1288cc24 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 18 Jun 2022 18:23:26 +0200 Subject: [PATCH] refactor: removed "module docker" statements --- containers.v | 2 -- docker.v | 10 ++++------ images.v | 2 -- stream.v | 2 -- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/containers.v b/containers.v index 8fbf027..e402d7c 100644 --- a/containers.v +++ b/containers.v @@ -1,5 +1,3 @@ -module docker - import json import net.urllib import time diff --git a/docker.v b/docker.v index ccc6bed..f510472 100644 --- a/docker.v +++ b/docker.v @@ -1,5 +1,3 @@ -module docker - import net.unix import io import net.http @@ -23,7 +21,7 @@ mut: // new_conn creates a new connection to the Docker daemon. pub fn new_conn() ?&DockerConn { - s := unix.connect_stream(docker.socket)? + s := unix.connect_stream(socket)? d := &DockerConn{ socket: s @@ -73,7 +71,7 @@ pub fn (mut d DockerConn) send_request_with_json(method http.Method, url urll pub fn (mut d DockerConn) read_response_head() ?http.Response { mut res := []u8{} - util.read_until_separator(mut d.reader, mut res, docker.http_separator)? + util.read_until_separator(mut d.reader, mut res, http_separator)? return http.parse_response(res.bytestr()) } @@ -85,9 +83,9 @@ pub fn (mut d DockerConn) read_response_body(length int) ?string { return '' } - mut buf := []u8{len: docker.buf_len} + mut buf := []u8{len: buf_len} mut c := 0 - mut builder := strings.new_builder(docker.buf_len) + mut builder := strings.new_builder(buf_len) for builder.len < length { c = d.reader.read(mut buf) or { break } diff --git a/images.v b/images.v index 6161565..3557847 100644 --- a/images.v +++ b/images.v @@ -1,5 +1,3 @@ -module docker - import net.http { Method } import net.urllib import json diff --git a/stream.v b/stream.v index 001f4b3..6566e10 100644 --- a/stream.v +++ b/stream.v @@ -1,5 +1,3 @@ -module docker - import io import util import encoding.binary