From b97f8cc56701e429f804e95808dc44fa402d7df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Mon, 1 Jan 2018 16:57:11 +0200 Subject: [PATCH] Fixing package structure --- server/Dockerfile => Dockerfile | 13 +++++-------- server/simplFTP.go => main.go | 2 +- server/{server => }/commands.go | 0 server/{server => }/config/config.go | 0 server/{server => }/config/config_test.go | 0 server/{server => }/connection.go | 2 +- server/{server => }/errors.go | 0 server/{server => }/parser.go | 0 server/{server => }/path.go | 0 server/{server => }/path_test.go | 0 server/{server => }/stack.go | 0 server/{server => }/stack_test.go | 0 12 files changed, 7 insertions(+), 10 deletions(-) rename server/Dockerfile => Dockerfile (52%) rename server/simplFTP.go => main.go (90%) rename server/{server => }/commands.go (100%) rename server/{server => }/config/config.go (100%) rename server/{server => }/config/config_test.go (100%) rename server/{server => }/connection.go (99%) rename server/{server => }/errors.go (100%) rename server/{server => }/parser.go (100%) rename server/{server => }/path.go (100%) rename server/{server => }/path_test.go (100%) rename server/{server => }/stack.go (100%) rename server/{server => }/stack_test.go (100%) diff --git a/server/Dockerfile b/Dockerfile similarity index 52% rename from server/Dockerfile rename to Dockerfile index ebcbca8..187f237 100644 --- a/server/Dockerfile +++ b/Dockerfile @@ -2,23 +2,20 @@ FROM golang:1.7 # Make a directory called simplFT -RUN mkdir -p /go/src/github.com/metonimie/simplFT/server +RUN mkdir -p /go/src/github.com/metonimie/simplFT/ # Copy the current dir contents into simplFT -ADD . /go/src/github.com/metonimie/simplFT/server +ADD . /go/src/github.com/metonimie/simplFT/ # Set the working directory to simplFT -WORKDIR /go/src/github.com/metonimie/simplFT/server - -# Make port 80 available to the world outside this container -EXPOSE 8080 +WORKDIR /go/src/github.com/metonimie/simplFT/ # Install dependencies RUN go get "github.com/zyxar/image2ascii/ascii" RUN go get "github.com/spf13/viper" # Build the application -RUN go build ./simplFTP.go +RUN go build ./main.go # Run simplFT when the container launches -CMD ["./simplFTP", "-config-name", "docker-config"] +CMD ["./main", "-config-name", "docker-config"] diff --git a/server/simplFTP.go b/main.go similarity index 90% rename from server/simplFTP.go rename to main.go index ac1dd4b..eed04b7 100644 --- a/server/simplFTP.go +++ b/main.go @@ -6,7 +6,7 @@ import ( "log" "sync" - "github.com/metonimie/simplFT/server/server" + "github.com/metonimie/simplFT/server" ) func main() { diff --git a/server/server/commands.go b/server/commands.go similarity index 100% rename from server/server/commands.go rename to server/commands.go diff --git a/server/server/config/config.go b/server/config/config.go similarity index 100% rename from server/server/config/config.go rename to server/config/config.go diff --git a/server/server/config/config_test.go b/server/config/config_test.go similarity index 100% rename from server/server/config/config_test.go rename to server/config/config_test.go diff --git a/server/server/connection.go b/server/connection.go similarity index 99% rename from server/server/connection.go rename to server/connection.go index 1f046af..baf51e0 100644 --- a/server/server/connection.go +++ b/server/connection.go @@ -17,7 +17,7 @@ import ( "sync" "github.com/fsnotify/fsnotify" - "github.com/metonimie/simplFT/server/server/config" + "github.com/metonimie/simplFT/server/config" "github.com/spf13/viper" ) diff --git a/server/server/errors.go b/server/errors.go similarity index 100% rename from server/server/errors.go rename to server/errors.go diff --git a/server/server/parser.go b/server/parser.go similarity index 100% rename from server/server/parser.go rename to server/parser.go diff --git a/server/server/path.go b/server/path.go similarity index 100% rename from server/server/path.go rename to server/path.go diff --git a/server/server/path_test.go b/server/path_test.go similarity index 100% rename from server/server/path_test.go rename to server/path_test.go diff --git a/server/server/stack.go b/server/stack.go similarity index 100% rename from server/server/stack.go rename to server/stack.go diff --git a/server/server/stack_test.go b/server/stack_test.go similarity index 100% rename from server/server/stack_test.go rename to server/stack_test.go