From 545db6a406c02926d6a0fa3b0bd707c5dad66d3d Mon Sep 17 00:00:00 2001 From: Kilemonn Date: Mon, 3 Feb 2025 19:37:10 +0900 Subject: [PATCH] Move all code up a directory and refactor imports. --- {flow/bidetwriter => bidetwriter}/bidetwriter.go | 0 {flow/bidetwriter => bidetwriter}/bidetwriter_test.go | 2 +- {flow/config => config}/apply.go | 0 {flow/config => config}/apply_test.go | 0 {flow/config => config}/config.go | 2 +- {flow/config => config}/config_file.go | 4 ++-- {flow/config => config}/config_file_test.go | 2 +- {flow/config => config}/config_ipc.go | 2 +- {flow/config => config}/config_port.go | 2 +- {flow/config => config}/config_settings.go | 0 {flow/config => config}/config_settings_test.go | 0 {flow/config => config}/config_socket.go | 2 +- {flow/config => config}/config_test.go | 2 +- {flow/config => config}/connection.yaml | 0 {flow/file => file}/sync_file_read_writer.go | 0 {flow/file => file}/sync_file_read_writer_test.go | 2 +- flow.go | 4 ++-- {flow/ipc => ipc}/ipc-reader.go | 2 +- {flow/ipc => ipc}/ipc-reader_test.go | 2 +- {flow/ipc => ipc}/ipc-writer.go | 0 {flow/queuedreader => queuedreader}/queuedreader.go | 0 {flow/queuedreader => queuedreader}/queuereader_test.go | 0 {flow/serial => serial}/custom_port.go | 0 {flow/serial => serial}/port.go | 0 {flow/serial => serial}/port_test_read_file.txt | 0 {flow/serial => serial}/serial.go | 2 +- {flow/socket => socket}/socket_reader.go | 0 {flow/socket => socket}/socket_reader_test.go | 2 +- {flow/socket => socket}/socket_writer.go | 0 {flow/socket => socket}/tcp_timeout_reader.go | 2 +- {flow/socket => socket}/udp_timeout_reader.go | 0 {flow/stdio => stdio}/stdin_reader.go | 0 {flow/stdio => stdio}/stdin_reader_test.go | 2 +- {flow/stdio => stdio}/stdout_writer.go | 2 +- {flow/stdio => stdio}/stdout_writer_test.go | 2 +- {flow/testutil => testutil}/testutil.go | 0 36 files changed, 20 insertions(+), 20 deletions(-) rename {flow/bidetwriter => bidetwriter}/bidetwriter.go (100%) rename {flow/bidetwriter => bidetwriter}/bidetwriter_test.go (97%) rename {flow/config => config}/apply.go (100%) rename {flow/config => config}/apply_test.go (100%) rename {flow/config => config}/config.go (99%) rename {flow/config => config}/config_file.go (94%) rename {flow/config => config}/config_file_test.go (99%) rename {flow/config => config}/config_ipc.go (92%) rename {flow/config => config}/config_port.go (97%) rename {flow/config => config}/config_settings.go (100%) rename {flow/config => config}/config_settings_test.go (100%) rename {flow/config => config}/config_socket.go (93%) rename {flow/config => config}/config_test.go (99%) rename {flow/config => config}/connection.yaml (100%) rename {flow/file => file}/sync_file_read_writer.go (100%) rename {flow/file => file}/sync_file_read_writer_test.go (97%) rename {flow/ipc => ipc}/ipc-reader.go (96%) rename {flow/ipc => ipc}/ipc-reader_test.go (98%) rename {flow/ipc => ipc}/ipc-writer.go (100%) rename {flow/queuedreader => queuedreader}/queuedreader.go (100%) rename {flow/queuedreader => queuedreader}/queuereader_test.go (100%) rename {flow/serial => serial}/custom_port.go (100%) rename {flow/serial => serial}/port.go (100%) rename {flow/serial => serial}/port_test_read_file.txt (100%) rename {flow/serial => serial}/serial.go (98%) rename {flow/socket => socket}/socket_reader.go (100%) rename {flow/socket => socket}/socket_reader_test.go (99%) rename {flow/socket => socket}/socket_writer.go (100%) rename {flow/socket => socket}/tcp_timeout_reader.go (98%) rename {flow/socket => socket}/udp_timeout_reader.go (100%) rename {flow/stdio => stdio}/stdin_reader.go (100%) rename {flow/stdio => stdio}/stdin_reader_test.go (96%) rename {flow/stdio => stdio}/stdout_writer.go (79%) rename {flow/stdio => stdio}/stdout_writer_test.go (95%) rename {flow/testutil => testutil}/testutil.go (100%) diff --git a/flow/bidetwriter/bidetwriter.go b/bidetwriter/bidetwriter.go similarity index 100% rename from flow/bidetwriter/bidetwriter.go rename to bidetwriter/bidetwriter.go diff --git a/flow/bidetwriter/bidetwriter_test.go b/bidetwriter/bidetwriter_test.go similarity index 97% rename from flow/bidetwriter/bidetwriter_test.go rename to bidetwriter/bidetwriter_test.go index 9f3e87d..5c6a85f 100644 --- a/flow/bidetwriter/bidetwriter_test.go +++ b/bidetwriter/bidetwriter_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/config/apply.go b/config/apply.go similarity index 100% rename from flow/config/apply.go rename to config/apply.go diff --git a/flow/config/apply_test.go b/config/apply_test.go similarity index 100% rename from flow/config/apply_test.go rename to config/apply_test.go diff --git a/flow/config/config.go b/config/config.go similarity index 99% rename from flow/config/config.go rename to config/config.go index 19fd4b6..75d5d8b 100644 --- a/flow/config/config.go +++ b/config/config.go @@ -5,7 +5,7 @@ import ( "io" "os" - "github.com/Kilemonn/flow/flow/stdio" + "github.com/Kilemonn/flow/stdio" "gopkg.in/yaml.v3" ) diff --git a/flow/config/config_file.go b/config/config_file.go similarity index 94% rename from flow/config/config_file.go rename to config/config_file.go index f6ed35d..4c7fe97 100644 --- a/flow/config/config_file.go +++ b/config/config_file.go @@ -7,8 +7,8 @@ import ( "io" "os" - "github.com/Kilemonn/flow/flow/bidetwriter" - "github.com/Kilemonn/flow/flow/file" + "github.com/Kilemonn/flow/bidetwriter" + "github.com/Kilemonn/flow/file" ) type ConfigFile struct { diff --git a/flow/config/config_file_test.go b/config/config_file_test.go similarity index 99% rename from flow/config/config_file_test.go rename to config/config_file_test.go index 276e608..ad0b328 100644 --- a/flow/config/config_file_test.go +++ b/config/config_file_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/config/config_ipc.go b/config/config_ipc.go similarity index 92% rename from flow/config/config_ipc.go rename to config/config_ipc.go index 53e9e70..7cf6468 100644 --- a/flow/config/config_ipc.go +++ b/config/config_ipc.go @@ -3,7 +3,7 @@ package config import ( "io" - "github.com/Kilemonn/flow/flow/ipc" + "github.com/Kilemonn/flow/ipc" ) type ConfigIPC struct { diff --git a/flow/config/config_port.go b/config/config_port.go similarity index 97% rename from flow/config/config_port.go rename to config/config_port.go index 7531d67..38c26be 100644 --- a/flow/config/config_port.go +++ b/config/config_port.go @@ -6,7 +6,7 @@ import ( "slices" "time" - "github.com/Kilemonn/flow/flow/serial" + "github.com/Kilemonn/flow/serial" goSerial "go.bug.st/serial" ) diff --git a/flow/config/config_settings.go b/config/config_settings.go similarity index 100% rename from flow/config/config_settings.go rename to config/config_settings.go diff --git a/flow/config/config_settings_test.go b/config/config_settings_test.go similarity index 100% rename from flow/config/config_settings_test.go rename to config/config_settings_test.go diff --git a/flow/config/config_socket.go b/config/config_socket.go similarity index 93% rename from flow/config/config_socket.go rename to config/config_socket.go index 8ac99d1..0ee8094 100644 --- a/flow/config/config_socket.go +++ b/config/config_socket.go @@ -3,7 +3,7 @@ package config import ( "io" - "github.com/Kilemonn/flow/flow/socket" + "github.com/Kilemonn/flow/socket" ) type ConfigSocket struct { diff --git a/flow/config/config_test.go b/config/config_test.go similarity index 99% rename from flow/config/config_test.go rename to config/config_test.go index bf9b8bd..1d331da 100644 --- a/flow/config/config_test.go +++ b/config/config_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" goSerial "go.bug.st/serial" ) diff --git a/flow/config/connection.yaml b/config/connection.yaml similarity index 100% rename from flow/config/connection.yaml rename to config/connection.yaml diff --git a/flow/file/sync_file_read_writer.go b/file/sync_file_read_writer.go similarity index 100% rename from flow/file/sync_file_read_writer.go rename to file/sync_file_read_writer.go diff --git a/flow/file/sync_file_read_writer_test.go b/file/sync_file_read_writer_test.go similarity index 97% rename from flow/file/sync_file_read_writer_test.go rename to file/sync_file_read_writer_test.go index 2022b65..834db12 100644 --- a/flow/file/sync_file_read_writer_test.go +++ b/file/sync_file_read_writer_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow.go b/flow.go index 8d1d34e..a1af28f 100644 --- a/flow.go +++ b/flow.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/Kilemonn/flow/flow/config" - "github.com/Kilemonn/flow/flow/serial" + "github.com/Kilemonn/flow/config" + "github.com/Kilemonn/flow/serial" ) const ( diff --git a/flow/ipc/ipc-reader.go b/ipc/ipc-reader.go similarity index 96% rename from flow/ipc/ipc-reader.go rename to ipc/ipc-reader.go index f5481cc..83d3b93 100644 --- a/flow/ipc/ipc-reader.go +++ b/ipc/ipc-reader.go @@ -4,7 +4,7 @@ import ( "io" "time" - "github.com/Kilemonn/flow/flow/queuedreader" + "github.com/Kilemonn/flow/queuedreader" ipcClient "github.com/Kilemonn/go-ipc/client" ipcServer "github.com/Kilemonn/go-ipc/server" ) diff --git a/flow/ipc/ipc-reader_test.go b/ipc/ipc-reader_test.go similarity index 98% rename from flow/ipc/ipc-reader_test.go rename to ipc/ipc-reader_test.go index 3801cee..af456ce 100644 --- a/flow/ipc/ipc-reader_test.go +++ b/ipc/ipc-reader_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/ipc/ipc-writer.go b/ipc/ipc-writer.go similarity index 100% rename from flow/ipc/ipc-writer.go rename to ipc/ipc-writer.go diff --git a/flow/queuedreader/queuedreader.go b/queuedreader/queuedreader.go similarity index 100% rename from flow/queuedreader/queuedreader.go rename to queuedreader/queuedreader.go diff --git a/flow/queuedreader/queuereader_test.go b/queuedreader/queuereader_test.go similarity index 100% rename from flow/queuedreader/queuereader_test.go rename to queuedreader/queuereader_test.go diff --git a/flow/serial/custom_port.go b/serial/custom_port.go similarity index 100% rename from flow/serial/custom_port.go rename to serial/custom_port.go diff --git a/flow/serial/port.go b/serial/port.go similarity index 100% rename from flow/serial/port.go rename to serial/port.go diff --git a/flow/serial/port_test_read_file.txt b/serial/port_test_read_file.txt similarity index 100% rename from flow/serial/port_test_read_file.txt rename to serial/port_test_read_file.txt diff --git a/flow/serial/serial.go b/serial/serial.go similarity index 98% rename from flow/serial/serial.go rename to serial/serial.go index 731df10..b27ca0a 100644 --- a/flow/serial/serial.go +++ b/serial/serial.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Kilemonn/flow/flow/stdio" + "github.com/Kilemonn/flow/stdio" goSerial "go.bug.st/serial" ) diff --git a/flow/socket/socket_reader.go b/socket/socket_reader.go similarity index 100% rename from flow/socket/socket_reader.go rename to socket/socket_reader.go diff --git a/flow/socket/socket_reader_test.go b/socket/socket_reader_test.go similarity index 99% rename from flow/socket/socket_reader_test.go rename to socket/socket_reader_test.go index e98330f..5c39509 100644 --- a/flow/socket/socket_reader_test.go +++ b/socket/socket_reader_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/socket/socket_writer.go b/socket/socket_writer.go similarity index 100% rename from flow/socket/socket_writer.go rename to socket/socket_writer.go diff --git a/flow/socket/tcp_timeout_reader.go b/socket/tcp_timeout_reader.go similarity index 98% rename from flow/socket/tcp_timeout_reader.go rename to socket/tcp_timeout_reader.go index 792ec33..7f2cdea 100644 --- a/flow/socket/tcp_timeout_reader.go +++ b/socket/tcp_timeout_reader.go @@ -5,7 +5,7 @@ import ( "slices" "time" - "github.com/Kilemonn/flow/flow/queuedreader" + "github.com/Kilemonn/flow/queuedreader" ) type TCPTimeoutReader struct { diff --git a/flow/socket/udp_timeout_reader.go b/socket/udp_timeout_reader.go similarity index 100% rename from flow/socket/udp_timeout_reader.go rename to socket/udp_timeout_reader.go diff --git a/flow/stdio/stdin_reader.go b/stdio/stdin_reader.go similarity index 100% rename from flow/stdio/stdin_reader.go rename to stdio/stdin_reader.go diff --git a/flow/stdio/stdin_reader_test.go b/stdio/stdin_reader_test.go similarity index 96% rename from flow/stdio/stdin_reader_test.go rename to stdio/stdin_reader_test.go index 02e1980..a0776ce 100644 --- a/flow/stdio/stdin_reader_test.go +++ b/stdio/stdin_reader_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/stdio/stdout_writer.go b/stdio/stdout_writer.go similarity index 79% rename from flow/stdio/stdout_writer.go rename to stdio/stdout_writer.go index dbdf8d0..cb900e6 100644 --- a/flow/stdio/stdout_writer.go +++ b/stdio/stdout_writer.go @@ -5,7 +5,7 @@ import ( "io" "os" - "github.com/Kilemonn/flow/flow/bidetwriter" + "github.com/Kilemonn/flow/bidetwriter" ) func CreateStdOutWriter() (io.WriteCloser, error) { diff --git a/flow/stdio/stdout_writer_test.go b/stdio/stdout_writer_test.go similarity index 95% rename from flow/stdio/stdout_writer_test.go rename to stdio/stdout_writer_test.go index 20244e0..2ccb910 100644 --- a/flow/stdio/stdout_writer_test.go +++ b/stdio/stdout_writer_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/Kilemonn/flow/flow/testutil" + "github.com/Kilemonn/flow/testutil" "github.com/stretchr/testify/require" ) diff --git a/flow/testutil/testutil.go b/testutil/testutil.go similarity index 100% rename from flow/testutil/testutil.go rename to testutil/testutil.go