From 4b03c7c59bf1918178d1ccabc3aa880001012b7b Mon Sep 17 00:00:00 2001 From: Joren Date: Sun, 15 Sep 2024 05:00:02 +0200 Subject: [PATCH] Change project structure --- Makefile | 13 +-- config.go => src/config.go | 0 downloaders.go => src/downloaders.go | 0 go.mod => src/go.mod | 0 go.sum => src/go.sum | 0 handlers.go => src/handlers.go | 0 main.go => src/main.go | 0 subtitles.go => src/subtitles.go | 0 {templates => src/templates}/index | 0 {templates => src/templates}/progress | 0 {templates => src/templates}/select | 0 src/templates/stats | 114 ++++++++++++++++++++++++++ utils.go => src/utils.go | 0 13 files changed, 121 insertions(+), 6 deletions(-) rename config.go => src/config.go (100%) rename downloaders.go => src/downloaders.go (100%) rename go.mod => src/go.mod (100%) rename go.sum => src/go.sum (100%) rename handlers.go => src/handlers.go (100%) rename main.go => src/main.go (100%) rename subtitles.go => src/subtitles.go (100%) rename {templates => src/templates}/index (100%) rename {templates => src/templates}/progress (100%) rename {templates => src/templates}/select (100%) create mode 100644 src/templates/stats rename utils.go => src/utils.go (100%) diff --git a/Makefile b/Makefile index ccf615a..f413c93 100644 --- a/Makefile +++ b/Makefile @@ -4,21 +4,22 @@ GOCLEAN=$(GOCMD) clean GOTEST=$(GOCMD) test GOGET=$(GOCMD) get BINARY_NAME=drmdtool +SRC_DIR=src all: test build build: - $(GOBUILD) -o $(BINARY_NAME) -v + cd $(SRC_DIR) && $(GOBUILD) -o ../$(BINARY_NAME) -v test: - $(GOTEST) -v ./... + cd $(SRC_DIR) && $(GOTEST) -v ./... clean: $(GOCLEAN) rm -f $(BINARY_NAME) run: - $(GOBUILD) -o $(BINARY_NAME) -v + cd $(SRC_DIR) && $(GOBUILD) -o ../$(BINARY_NAME) -v ./$(BINARY_NAME) deps: @@ -28,12 +29,12 @@ deps: # Cross compilation build-linux: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_linux -v + cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o ../$(BINARY_NAME)_linux -v build-windows: - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME).exe -v + cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o ../$(BINARY_NAME).exe -v build-mac: - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_mac -v + cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o ../$(BINARY_NAME)_mac -v .PHONY: all build test clean run deps build-linux build-windows build-mac diff --git a/config.go b/src/config.go similarity index 100% rename from config.go rename to src/config.go diff --git a/downloaders.go b/src/downloaders.go similarity index 100% rename from downloaders.go rename to src/downloaders.go diff --git a/go.mod b/src/go.mod similarity index 100% rename from go.mod rename to src/go.mod diff --git a/go.sum b/src/go.sum similarity index 100% rename from go.sum rename to src/go.sum diff --git a/handlers.go b/src/handlers.go similarity index 100% rename from handlers.go rename to src/handlers.go diff --git a/main.go b/src/main.go similarity index 100% rename from main.go rename to src/main.go diff --git a/subtitles.go b/src/subtitles.go similarity index 100% rename from subtitles.go rename to src/subtitles.go diff --git a/templates/index b/src/templates/index similarity index 100% rename from templates/index rename to src/templates/index diff --git a/templates/progress b/src/templates/progress similarity index 100% rename from templates/progress rename to src/templates/progress diff --git a/templates/select b/src/templates/select similarity index 100% rename from templates/select rename to src/templates/select diff --git a/src/templates/stats b/src/templates/stats new file mode 100644 index 0000000..2cbf1b9 --- /dev/null +++ b/src/templates/stats @@ -0,0 +1,114 @@ + + + + + + Network Stats + + + + +

Network Stats

+
+
+

Upload Speed

+

0 MB/s

+

Total Upload

+

0 MB

+
+
+

Download Speed

+

0 MB/s

+

Total Download

+

0 MB

+
+
+ + + + \ No newline at end of file diff --git a/utils.go b/src/utils.go similarity index 100% rename from utils.go rename to src/utils.go