From eff2072fdcc46cc6372f7113b5229dbc8bf269b2 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Wed, 22 Jun 2022 09:15:00 +0200 Subject: [PATCH] refactor: renamed project to docker --- containers.v | 2 +- docker.v | 14 +++++++------- errors.v | 2 +- images.v | 2 +- stream.v | 2 +- v.mod | 2 +- volumes.v | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/containers.v b/containers.v index 0aee8f4..8b116bc 100644 --- a/containers.v +++ b/containers.v @@ -1,4 +1,4 @@ -module vdocker +module docker import json import time diff --git a/docker.v b/docker.v index a171a2e..2963f0d 100644 --- a/docker.v +++ b/docker.v @@ -1,4 +1,4 @@ -module vdocker +module docker import net.unix import io @@ -25,7 +25,7 @@ mut: // new_conn creates a new connection to the Docker daemon. pub fn new_conn() ?&DockerConn { - s := unix.connect_stream(vdocker.socket)? + s := unix.connect_stream(docker.socket)? d := &DockerConn{ socket: s @@ -42,7 +42,7 @@ pub fn (mut d DockerConn) close() ? { // send_request sends an HTTP request without body. fn (mut d DockerConn) send_request(method http.Method, url_str string) ? { - url := urllib.parse('/$vdocker.api_version$url_str')? + url := urllib.parse('/$docker.api_version$url_str')? req := '$method $url.request_uri() HTTP/1.1\nHost: localhost\n\n' d.socket.write_string(req)? @@ -53,7 +53,7 @@ fn (mut d DockerConn) send_request(method http.Method, url_str string) ? { // send_request_with_body sends an HTTP request with the given body. fn (mut d DockerConn) send_request_with_body(method http.Method, url_str string, content_type string, body string) ? { - url := urllib.parse('/$vdocker.api_version$url_str')? + url := urllib.parse('/$docker.api_version$url_str')? req := '$method $url.request_uri() HTTP/1.1\nHost: localhost\nContent-Type: $content_type\nContent-Length: $body.len\n\n$body\n\n' d.socket.write_string(req)? @@ -77,7 +77,7 @@ fn (mut d DockerConn) send_request_with_json(method http.Method, url_str stri fn (mut d DockerConn) read_response_head() ?http.Response { mut res := []u8{} - util.read_until_separator(mut d.reader, mut res, vdocker.http_separator)? + util.read_until_separator(mut d.reader, mut res, docker.http_separator)? return http.parse_response(res.bytestr()) } @@ -89,9 +89,9 @@ fn (mut d DockerConn) read_response_body(length int) ?string { return '' } - mut buf := []u8{len: vdocker.buf_len} + mut buf := []u8{len: docker.buf_len} mut c := 0 - mut builder := strings.new_builder(vdocker.buf_len) + mut builder := strings.new_builder(docker.buf_len) for builder.len < length { c = d.reader.read(mut buf) or { break } diff --git a/errors.v b/errors.v index e5da55a..717f9fc 100644 --- a/errors.v +++ b/errors.v @@ -1,4 +1,4 @@ -module vdocker +module docker struct DockerError { status int [skip] diff --git a/images.v b/images.v index aeaa53f..8506047 100644 --- a/images.v +++ b/images.v @@ -1,4 +1,4 @@ -module vdocker +module docker import net.http { Method } import json diff --git a/stream.v b/stream.v index 6c1d88f..001f4b3 100644 --- a/stream.v +++ b/stream.v @@ -1,4 +1,4 @@ -module vdocker +module docker import io import util diff --git a/v.mod b/v.mod index bc42cd7..b36e97d 100644 --- a/v.mod +++ b/v.mod @@ -1,5 +1,5 @@ Module { - name: 'vdocker' + name: 'docker' description: 'Library for interacting with the Docker HTTP API' version: '0.0.0' license: 'MIT' diff --git a/volumes.v b/volumes.v index 9642198..00db10a 100644 --- a/volumes.v +++ b/volumes.v @@ -1,4 +1,4 @@ -module vdocker +module docker import net.http { Method } import time