diff --git a/.gitignore b/.gitignore index 90242944..e5fc9402 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ .idea .DS_Store bin -volumes/nodes +internal/volumes/nodes dist/ -pkg/modules/*/aof -pkg/echovault/aof dump.rdb **/*/testdata +echovault/aof diff --git a/Dockerfile.dev b/Dockerfile.dev index 20e0db9d..6a493072 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -8,11 +8,11 @@ COPY . ./ ENV CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64 ENV DEST=volumes/modules -RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_set/module_set.so ./volumes/modules/module_set/module_set.go -RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_get/module_get.so ./volumes/modules/module_get/module_get.go +RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go +RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go ENV DEST=bin/linux/x86_64 -RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server ./cmd/main.go +RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server . diff --git a/Makefile b/Makefile index 12d543ba..54d16636 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,14 @@ run: docker-compose up --build build-local: - CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \ - CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go && \ - CGO_ENABLED=1 go build -o ./bin ./cmd/... + CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go && \ + CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go && \ + CGO_ENABLED=1 go build -o ./bin ./... build-modules-test: - CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \ - CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go + CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go && \ + CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go test: env RACE=false OUT=internal/modules/admin/testdata make build-modules-test && \ diff --git a/docker-compose.yaml b/docker-compose.yaml index 713e8ad1..c6e4815e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -45,8 +45,8 @@ services: - "7480:7480" - "7946:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/standalone_node:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/standalone_node:/var/lib/echovault networks: - testnet @@ -89,8 +89,8 @@ services: - "7481:7480" - "7945:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/cluster_node_1:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_1:/var/lib/echovault networks: - testnet @@ -133,8 +133,8 @@ services: - "7482:7480" - "7947:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/cluster_node_2:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_2:/var/lib/echovault networks: - testnet @@ -177,8 +177,8 @@ services: - "7483:7480" - "7948:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/cluster_node_3:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_3:/var/lib/echovault networks: - testnet @@ -221,8 +221,8 @@ services: - "7484:7480" - "7949:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/cluster_node_4:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_4:/var/lib/echovault networks: - testnet @@ -265,7 +265,7 @@ services: - "7485:7480" - "7950:7946" volumes: - - ./volumes/config:/etc/echovault/config - - ./volumes/nodes/cluster_node_5:/var/lib/echovault + - ./internal/volumes/config:/etc/echovault/config + - ./internal/volumes/nodes/cluster_node_5:/var/lib/echovault networks: - testnet \ No newline at end of file diff --git a/volumes/config/acl.json b/internal/volumes/config/acl.json similarity index 100% rename from volumes/config/acl.json rename to internal/volumes/config/acl.json diff --git a/volumes/config/acl.yml b/internal/volumes/config/acl.yml similarity index 100% rename from volumes/config/acl.yml rename to internal/volumes/config/acl.yml diff --git a/volumes/modules/module_get/module_get.go b/internal/volumes/modules/module_get/module_get.go similarity index 100% rename from volumes/modules/module_get/module_get.go rename to internal/volumes/modules/module_get/module_get.go diff --git a/volumes/modules/module_set/module_set.go b/internal/volumes/modules/module_set/module_set.go similarity index 100% rename from volumes/modules/module_set/module_set.go rename to internal/volumes/modules/module_set/module_set.go diff --git a/cmd/main.go b/main.go similarity index 100% rename from cmd/main.go rename to main.go