diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index b9546b0..0000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -data -vendor diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3eac9b3..549c7d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,21 @@ jobs: steps: - uses: actions/checkout@v4 + - id: version + name: Set up build version + run: | + if [[ $GITHUB_REF_TYPE == "tag" ]]; then + VERSION=${GITHUB_REF#refs/tags/} + else + BRANCH_NAME=${GITHUB_REF#refs/heads/} + SHORT_SHA=$(git rev-parse --short $GITHUB_SHA) + VERSION="${BRANCH_NAME}-${SHORT_SHA}" + fi + echo "### Version: $VERSION" >> $GITHUB_STEP_SUMMARY + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: cache-dependency-path: go.sum go-version-file: go.mod @@ -45,9 +58,23 @@ jobs: run: go test -v -race --tags redis -coverprofile=coverage.txt -covermode=atomic ./... - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4-beta + uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Build - run: go build ./... + env: + CGO_ENABLED: 'false' + run: > + go build + -trimpath + -ldflags "-w -s -X github.com/elyby/chrly/internal/version.version=${{ steps.version.outputs.version }} -X github.com/elyby/chrly/internal/version.commit=${{ github.sha }}" \ + -o ./chrly + ./cmd/chrly/... + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: chrly-build-linux-amd64-${{ steps.version.outputs.version }} + path: ./chrly + compression-level: 0 diff --git a/.gitignore b/.gitignore index efa479e..d5ad198 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,11 @@ -.idea -docker-compose.yml -docker-compose.override.yml -vendor -.cover +# IDE files +.idea/ +*.iml +.vscode + +# Go mod vendoring +/vendor + +# Local environment +/docker-compose.yml +/data diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6a74a63..0000000 --- a/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM golang:1.21-alpine AS builder - -ARG VERSION=unversioned -ARG COMMIT=unspecified - -COPY . /build -WORKDIR /build -RUN go mod download - -RUN CGO_ENABLED=0 \ - go build \ - -trimpath \ - -ldflags "-w -s -X github.com/elyby/chrly/version.version=$VERSION -X github.com/elyby/chrly/version.commit=$COMMIT" \ - -o chrly \ - main.go - -FROM alpine:3.19 - -EXPOSE 80 -ENV STORAGE_REDIS_HOST=redis -ENV STORAGE_FILESYSTEM_HOST=/data - -COPY docker-entrypoint.sh / -COPY --from=builder /build/chrly /usr/local/bin/chrly - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["serve"] diff --git a/build/package/Dockerfile b/build/package/Dockerfile new file mode 100644 index 0000000..3b95388 --- /dev/null +++ b/build/package/Dockerfile @@ -0,0 +1,12 @@ +# syntax=docker/dockerfile:1 +ARG BINARY + +FROM scratch + +EXPOSE 80 + +COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY ${BINARY} /usr/local/bin/chrly + +ENTRYPOINT ["/usr/local/bin/chrly"] +CMD ["serve"] diff --git a/cmd/chrly/chrly.go b/cmd/chrly/chrly.go new file mode 100644 index 0000000..efcddc6 --- /dev/null +++ b/cmd/chrly/chrly.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "os" + + . "github.com/elyby/chrly/internal/cmd" +) + +func main() { + err := RootCmd.Execute() + if err != nil { + fmt.Println(err) + os.Exit(1) + } +} diff --git a/data/redis/.gitignore b/data/redis/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/data/redis/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml new file mode 100644 index 0000000..6af4ef0 --- /dev/null +++ b/deploy/docker/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' +services: + chrly: + image: elyby/chrly:latest + restart: always + ports: + - "80:80" + environment: + CHRLY_SECRET: replace_this_value_in_production + STORAGE_REDIS_HOST: redis + + redis: + image: redis:latest + restart: always + volumes: + - ./data/redis:/data diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index 20e6f82..0000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,14 +0,0 @@ -# This file can be used to start up necessary services. -# Copy it into the docker-compose.yml: -# > cp docker-compose.dev.yml docker-compose.yml -# And then run it: -# > docker-compose up -d - -version: '2' -services: - redis: - image: redis:4.0-32bit - ports: - - "6379:6379" - volumes: - - ./data/redis:/data diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml deleted file mode 100644 index ca4e940..0000000 --- a/docker-compose.prod.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This file can be used to run application in the production environment. -# Copy it into the docker-compose.yml: -# > cp docker-compose.prod.yml docker-compose.yml -# And then run it: -# > docker-compose up -d -# Service will be listened at the http://localhost - -version: '2' -services: - app: - image: elyby/chrly - hostname: chrly0 - restart: always - links: - - redis - volumes: - - ./data/capes:/data/capes - ports: - - "80:80" - environment: - CHRLY_SECRET: replace_this_value_in_production - - redis: - image: redis:4.0-32bit # 32-bit version is recommended to spare some memory - restart: always - volumes: - - ./data/redis:/data diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100755 index de3fa34..0000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -if [ ! -d /data/capes ]; then - mkdir -p /data/capes -fi - -if [ "$1" = "serve" ] || [ "$1" = "token" ] || [ "$1" = "version" ]; then - set -- /usr/local/bin/chrly "$@" -fi - -exec "$@" diff --git a/cmd/root.go b/internal/cmd/root.go similarity index 64% rename from cmd/root.go rename to internal/cmd/root.go index 8890a38..ef9b547 100644 --- a/cmd/root.go +++ b/internal/cmd/root.go @@ -1,35 +1,24 @@ package cmd import ( - "fmt" "log" - "os" "strings" . "github.com/defval/di" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/elyby/chrly/di" - "github.com/elyby/chrly/http" - "github.com/elyby/chrly/version" + "github.com/elyby/chrly/internal/di" + "github.com/elyby/chrly/internal/http" + "github.com/elyby/chrly/internal/version" ) var RootCmd = &cobra.Command{ Use: "chrly", - Short: "Implementation of Minecraft skins system server", + Short: "Implementation of the Minecraft skins system server", Version: version.Version(), } -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - if err := RootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} - func shouldGetContainer() *Container { container, err := di.New() if err != nil { diff --git a/cmd/root_profiling.go b/internal/cmd/root_profiling.go similarity index 100% rename from cmd/root_profiling.go rename to internal/cmd/root_profiling.go diff --git a/cmd/serve.go b/internal/cmd/serve.go similarity index 100% rename from cmd/serve.go rename to internal/cmd/serve.go diff --git a/cmd/token.go b/internal/cmd/token.go similarity index 93% rename from cmd/token.go rename to internal/cmd/token.go index 75144ef..c54ae8d 100644 --- a/cmd/token.go +++ b/internal/cmd/token.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/elyby/chrly/http" + "github.com/elyby/chrly/internal/http" "github.com/spf13/cobra" ) diff --git a/cmd/version.go b/internal/cmd/version.go similarity index 93% rename from cmd/version.go rename to internal/cmd/version.go index 4495674..2faa515 100644 --- a/cmd/version.go +++ b/internal/cmd/version.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" - "github.com/elyby/chrly/version" + "github.com/elyby/chrly/internal/version" ) var versionCmd = &cobra.Command{ diff --git a/db/model.go b/internal/db/model.go similarity index 100% rename from db/model.go rename to internal/db/model.go diff --git a/db/redis/redis.go b/internal/db/redis/redis.go similarity index 99% rename from db/redis/redis.go rename to internal/db/redis/redis.go index 94e791f..d209bea 100644 --- a/db/redis/redis.go +++ b/internal/db/redis/redis.go @@ -7,7 +7,7 @@ import ( "github.com/mediocregopher/radix/v4" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" ) const usernameToProfileKey = "hash:username-to-profile" diff --git a/db/redis/redis_integration_test.go b/internal/db/redis/redis_integration_test.go similarity index 99% rename from db/redis/redis_integration_test.go rename to internal/db/redis/redis_integration_test.go index bc6daa6..8f9f032 100644 --- a/db/redis/redis_integration_test.go +++ b/internal/db/redis/redis_integration_test.go @@ -15,7 +15,7 @@ import ( assert "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" ) var redisAddr string diff --git a/db/serializer.go b/internal/db/serializer.go similarity index 100% rename from db/serializer.go rename to internal/db/serializer.go diff --git a/db/serializer_test.go b/internal/db/serializer_test.go similarity index 100% rename from db/serializer_test.go rename to internal/db/serializer_test.go diff --git a/di/config.go b/internal/di/config.go similarity index 100% rename from di/config.go rename to internal/di/config.go diff --git a/di/db.go b/internal/di/db.go similarity index 88% rename from di/db.go rename to internal/di/db.go index 9757738..2836ed6 100644 --- a/di/db.go +++ b/internal/di/db.go @@ -7,11 +7,11 @@ import ( "github.com/defval/di" "github.com/spf13/viper" - db2 "github.com/elyby/chrly/db" - "github.com/elyby/chrly/db/redis" - es "github.com/elyby/chrly/eventsubscribers" + db2 "github.com/elyby/chrly/internal/db" + "github.com/elyby/chrly/internal/db/redis" + es "github.com/elyby/chrly/internal/eventsubscribers" + "github.com/elyby/chrly/internal/mojang" "github.com/elyby/chrly/internal/profiles" - "github.com/elyby/chrly/mojang" ) // v4 had the idea that it would be possible to separate backends for storing skins and capes. diff --git a/di/di.go b/internal/di/di.go similarity index 100% rename from di/di.go rename to internal/di/di.go diff --git a/di/dispatcher.go b/internal/di/dispatcher.go similarity index 83% rename from di/dispatcher.go rename to internal/di/dispatcher.go index 2ca665b..515af54 100644 --- a/di/dispatcher.go +++ b/internal/di/dispatcher.go @@ -4,9 +4,9 @@ import ( "github.com/defval/di" "github.com/mono83/slf" - d "github.com/elyby/chrly/dispatcher" - "github.com/elyby/chrly/eventsubscribers" - "github.com/elyby/chrly/http" + d "github.com/elyby/chrly/internal/dispatcher" + "github.com/elyby/chrly/internal/eventsubscribers" + "github.com/elyby/chrly/internal/http" ) var dispatcher = di.Options( diff --git a/di/handlers.go b/internal/di/handlers.go similarity index 98% rename from di/handlers.go rename to internal/di/handlers.go index 2cb5118..ce67473 100644 --- a/di/handlers.go +++ b/internal/di/handlers.go @@ -10,7 +10,7 @@ import ( "github.com/gorilla/mux" "github.com/spf13/viper" - . "github.com/elyby/chrly/http" + . "github.com/elyby/chrly/internal/http" ) var handlers = di.Options( diff --git a/di/logger.go b/internal/di/logger.go similarity index 95% rename from di/logger.go rename to internal/di/logger.go index 3b27b7a..c1f6bfd 100644 --- a/di/logger.go +++ b/internal/di/logger.go @@ -13,8 +13,8 @@ import ( "github.com/mono83/slf/wd" "github.com/spf13/viper" - "github.com/elyby/chrly/eventsubscribers" - "github.com/elyby/chrly/version" + "github.com/elyby/chrly/internal/eventsubscribers" + "github.com/elyby/chrly/internal/version" ) var logger = di.Options( diff --git a/di/mojang_textures.go b/internal/di/mojang_textures.go similarity index 98% rename from di/mojang_textures.go rename to internal/di/mojang_textures.go index 1313d19..5422a6d 100644 --- a/di/mojang_textures.go +++ b/internal/di/mojang_textures.go @@ -8,8 +8,8 @@ import ( "github.com/defval/di" "github.com/spf13/viper" + "github.com/elyby/chrly/internal/mojang" "github.com/elyby/chrly/internal/profiles" - "github.com/elyby/chrly/mojang" ) var mojangTextures = di.Options( diff --git a/di/profiles.go b/internal/di/profiles.go similarity index 93% rename from di/profiles.go rename to internal/di/profiles.go index 9425a7c..dc0bad4 100644 --- a/di/profiles.go +++ b/internal/di/profiles.go @@ -3,7 +3,7 @@ package di import ( "github.com/defval/di" - . "github.com/elyby/chrly/http" + . "github.com/elyby/chrly/internal/http" "github.com/elyby/chrly/internal/profiles" ) diff --git a/di/server.go b/internal/di/server.go similarity index 98% rename from di/server.go rename to internal/di/server.go index fc21ee8..ae4035a 100644 --- a/di/server.go +++ b/internal/di/server.go @@ -11,7 +11,7 @@ import ( "github.com/getsentry/raven-go" "github.com/spf13/viper" - . "github.com/elyby/chrly/http" + . "github.com/elyby/chrly/internal/http" ) var server = di.Options( diff --git a/di/signer.go b/internal/di/signer.go similarity index 91% rename from di/signer.go rename to internal/di/signer.go index 35f09f1..7d48106 100644 --- a/di/signer.go +++ b/internal/di/signer.go @@ -5,10 +5,11 @@ import ( "encoding/base64" "encoding/pem" "errors" - "github.com/elyby/chrly/http" - . "github.com/elyby/chrly/signer" "strings" + "github.com/elyby/chrly/internal/http" + . "github.com/elyby/chrly/internal/signer" + "github.com/defval/di" "github.com/spf13/viper" ) diff --git a/dispatcher/dispatcher.go b/internal/dispatcher/dispatcher.go similarity index 100% rename from dispatcher/dispatcher.go rename to internal/dispatcher/dispatcher.go diff --git a/eventsubscribers/health_checkers.go b/internal/eventsubscribers/health_checkers.go similarity index 100% rename from eventsubscribers/health_checkers.go rename to internal/eventsubscribers/health_checkers.go diff --git a/eventsubscribers/health_checkers_test.go b/internal/eventsubscribers/health_checkers_test.go similarity index 100% rename from eventsubscribers/health_checkers_test.go rename to internal/eventsubscribers/health_checkers_test.go diff --git a/eventsubscribers/logger.go b/internal/eventsubscribers/logger.go similarity index 100% rename from eventsubscribers/logger.go rename to internal/eventsubscribers/logger.go diff --git a/eventsubscribers/logger_test.go b/internal/eventsubscribers/logger_test.go similarity index 98% rename from eventsubscribers/logger_test.go rename to internal/eventsubscribers/logger_test.go index 00a67a8..eb94b46 100644 --- a/eventsubscribers/logger_test.go +++ b/internal/eventsubscribers/logger_test.go @@ -9,7 +9,7 @@ import ( "github.com/mono83/slf/params" "github.com/stretchr/testify/mock" - "github.com/elyby/chrly/dispatcher" + "github.com/elyby/chrly/internal/dispatcher" ) type LoggerMock struct { diff --git a/eventsubscribers/stats_reporter.go b/internal/eventsubscribers/stats_reporter.go similarity index 100% rename from eventsubscribers/stats_reporter.go rename to internal/eventsubscribers/stats_reporter.go diff --git a/eventsubscribers/stats_reporter_test.go b/internal/eventsubscribers/stats_reporter_test.go similarity index 99% rename from eventsubscribers/stats_reporter_test.go rename to internal/eventsubscribers/stats_reporter_test.go index f6099ef..b52a6bc 100644 --- a/eventsubscribers/stats_reporter_test.go +++ b/internal/eventsubscribers/stats_reporter_test.go @@ -8,7 +8,7 @@ import ( "github.com/mono83/slf" - "github.com/elyby/chrly/dispatcher" + "github.com/elyby/chrly/internal/dispatcher" "github.com/stretchr/testify/mock" ) diff --git a/eventsubscribers/subscriber.go b/internal/eventsubscribers/subscriber.go similarity index 60% rename from eventsubscribers/subscriber.go rename to internal/eventsubscribers/subscriber.go index 00aea01..61f2254 100644 --- a/eventsubscribers/subscriber.go +++ b/internal/eventsubscribers/subscriber.go @@ -1,6 +1,6 @@ package eventsubscribers -import "github.com/elyby/chrly/dispatcher" +import "github.com/elyby/chrly/internal/dispatcher" type Subscriber interface { dispatcher.Subscriber diff --git a/http/api.go b/internal/http/api.go similarity index 97% rename from http/api.go rename to internal/http/api.go index af54e16..c569e86 100644 --- a/http/api.go +++ b/internal/http/api.go @@ -6,7 +6,7 @@ import ( "github.com/gorilla/mux" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" "github.com/elyby/chrly/internal/profiles" ) diff --git a/http/api_test.go b/internal/http/api_test.go similarity index 99% rename from http/api_test.go rename to internal/http/api_test.go index 2fb482c..8b68475 100644 --- a/http/api_test.go +++ b/internal/http/api_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" "github.com/elyby/chrly/internal/profiles" ) diff --git a/http/http.go b/internal/http/http.go similarity index 97% rename from http/http.go rename to internal/http/http.go index bdeb548..783e618 100644 --- a/http/http.go +++ b/internal/http/http.go @@ -15,8 +15,8 @@ import ( "github.com/mono83/slf" "github.com/mono83/slf/wd" - "github.com/elyby/chrly/dispatcher" - v "github.com/elyby/chrly/version" + "github.com/elyby/chrly/internal/dispatcher" + v "github.com/elyby/chrly/internal/version" ) type Emitter interface { diff --git a/http/http_test.go b/internal/http/http_test.go similarity index 100% rename from http/http_test.go rename to internal/http/http_test.go diff --git a/http/jwt.go b/internal/http/jwt.go similarity index 100% rename from http/jwt.go rename to internal/http/jwt.go diff --git a/http/jwt_test.go b/internal/http/jwt_test.go similarity index 100% rename from http/jwt_test.go rename to internal/http/jwt_test.go diff --git a/http/skinsystem.go b/internal/http/skinsystem.go similarity index 98% rename from http/skinsystem.go rename to internal/http/skinsystem.go index b910455..5291f21 100644 --- a/http/skinsystem.go +++ b/internal/http/skinsystem.go @@ -12,9 +12,9 @@ import ( "github.com/gorilla/mux" - "github.com/elyby/chrly/db" - "github.com/elyby/chrly/mojang" - "github.com/elyby/chrly/utils" + "github.com/elyby/chrly/internal/db" + "github.com/elyby/chrly/internal/mojang" + "github.com/elyby/chrly/internal/utils" ) var timeNow = time.Now diff --git a/http/skinsystem_test.go b/internal/http/skinsystem_test.go similarity index 99% rename from http/skinsystem_test.go rename to internal/http/skinsystem_test.go index b09f2ef..d2ef492 100644 --- a/http/skinsystem_test.go +++ b/internal/http/skinsystem_test.go @@ -16,7 +16,7 @@ import ( testify "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" ) type ProfilesProviderMock struct { diff --git a/mojang/batch_uuids_provider.go b/internal/mojang/batch_uuids_provider.go similarity index 98% rename from mojang/batch_uuids_provider.go rename to internal/mojang/batch_uuids_provider.go index c89c628..03ec7b1 100644 --- a/mojang/batch_uuids_provider.go +++ b/internal/mojang/batch_uuids_provider.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/elyby/chrly/utils" + "github.com/elyby/chrly/internal/utils" ) type BatchUuidsProvider struct { diff --git a/mojang/batch_uuids_provider_test.go b/internal/mojang/batch_uuids_provider_test.go similarity index 100% rename from mojang/batch_uuids_provider_test.go rename to internal/mojang/batch_uuids_provider_test.go diff --git a/mojang/client.go b/internal/mojang/client.go similarity index 100% rename from mojang/client.go rename to internal/mojang/client.go diff --git a/mojang/client_test.go b/internal/mojang/client_test.go similarity index 100% rename from mojang/client_test.go rename to internal/mojang/client_test.go diff --git a/mojang/provider.go b/internal/mojang/provider.go similarity index 100% rename from mojang/provider.go rename to internal/mojang/provider.go diff --git a/mojang/provider_test.go b/internal/mojang/provider_test.go similarity index 100% rename from mojang/provider_test.go rename to internal/mojang/provider_test.go diff --git a/mojang/textures_provider.go b/internal/mojang/textures_provider.go similarity index 100% rename from mojang/textures_provider.go rename to internal/mojang/textures_provider.go diff --git a/mojang/textures_provider_test.go b/internal/mojang/textures_provider_test.go similarity index 100% rename from mojang/textures_provider_test.go rename to internal/mojang/textures_provider_test.go diff --git a/mojang/uuids_provider.go b/internal/mojang/uuids_provider.go similarity index 100% rename from mojang/uuids_provider.go rename to internal/mojang/uuids_provider.go diff --git a/mojang/uuids_provider_test.go b/internal/mojang/uuids_provider_test.go similarity index 100% rename from mojang/uuids_provider_test.go rename to internal/mojang/uuids_provider_test.go diff --git a/internal/profiles/manager.go b/internal/profiles/manager.go index c493e2d..cd7a9d5 100644 --- a/internal/profiles/manager.go +++ b/internal/profiles/manager.go @@ -7,7 +7,7 @@ import ( "github.com/go-playground/validator/v10" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" ) type ProfilesRepository interface { diff --git a/internal/profiles/manager_test.go b/internal/profiles/manager_test.go index fdd4fc5..54e3f3b 100644 --- a/internal/profiles/manager_test.go +++ b/internal/profiles/manager_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/elyby/chrly/db" + "github.com/elyby/chrly/internal/db" ) type ProfilesRepositoryMock struct { diff --git a/internal/profiles/provider.go b/internal/profiles/provider.go index 3fbd8b8..a2565b2 100644 --- a/internal/profiles/provider.go +++ b/internal/profiles/provider.go @@ -3,8 +3,8 @@ package profiles import ( "errors" - "github.com/elyby/chrly/db" - "github.com/elyby/chrly/mojang" + "github.com/elyby/chrly/internal/db" + "github.com/elyby/chrly/internal/mojang" ) type ProfilesFinder interface { diff --git a/internal/profiles/provider_test.go b/internal/profiles/provider_test.go index 65d4c33..8ebe274 100644 --- a/internal/profiles/provider_test.go +++ b/internal/profiles/provider_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/elyby/chrly/db" - "github.com/elyby/chrly/mojang" - "github.com/elyby/chrly/utils" + "github.com/elyby/chrly/internal/db" + "github.com/elyby/chrly/internal/mojang" + "github.com/elyby/chrly/internal/utils" ) type ProfilesFinderMock struct { diff --git a/signer/signer.go b/internal/signer/signer.go similarity index 100% rename from signer/signer.go rename to internal/signer/signer.go diff --git a/signer/signer_test.go b/internal/signer/signer_test.go similarity index 100% rename from signer/signer_test.go rename to internal/signer/signer_test.go diff --git a/utils/queue.go b/internal/utils/queue.go similarity index 100% rename from utils/queue.go rename to internal/utils/queue.go diff --git a/utils/queue_test.go b/internal/utils/queue_test.go similarity index 100% rename from utils/queue_test.go rename to internal/utils/queue_test.go diff --git a/utils/time.go b/internal/utils/time.go similarity index 100% rename from utils/time.go rename to internal/utils/time.go diff --git a/utils/time_test.go b/internal/utils/time_test.go similarity index 100% rename from utils/time_test.go rename to internal/utils/time_test.go diff --git a/version/version.go b/internal/version/version.go similarity index 71% rename from version/version.go rename to internal/version/version.go index 89e6def..7fc7cff 100644 --- a/version/version.go +++ b/internal/version/version.go @@ -1,8 +1,8 @@ package version var ( - version = "" - commit = "" + version = "undefined" + commit = "unknown" ) func Version() string { diff --git a/main.go b/main.go deleted file mode 100644 index 1a95996..0000000 --- a/main.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "runtime" - - "github.com/elyby/chrly/cmd" -) - -func main() { - runtime.GOMAXPROCS(runtime.NumCPU()) - cmd.Execute() -}