diff --git a/.gitignore b/.gitignore index baddb11..0d17025 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /api/Authenticator.json /api/Authenticator.yaml *.exe -/src/src +/app/app /.vscode /.ignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c26124d..e5674c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,14 @@ RUN apk add --no-cache git # Set working directory WORKDIR /app -# Copy go mod files from src directory -COPY src/go.mod src/go.sum ./ +# Copy go mod files from root directory +COPY go.mod go.sum ./ # Download dependencies RUN go mod download -# Copy source code from src directory -COPY src/ . +# Copy source code from app directory +COPY app/ . # Build the application RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o authenticator authenticator.go diff --git a/src/authenticator.go b/app/authenticator.go similarity index 72% rename from src/authenticator.go rename to app/authenticator.go index ce16b85..f7f1721 100644 --- a/src/authenticator.go +++ b/app/authenticator.go @@ -4,9 +4,9 @@ import ( "flag" "fmt" - "src/internal/config" - "src/internal/handler" - "src/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/config" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/handler" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/rest" diff --git a/src/etc/authenticator.yaml b/app/etc/authenticator.yaml similarity index 100% rename from src/etc/authenticator.yaml rename to app/etc/authenticator.yaml diff --git a/src/internal/config/config.go b/app/internal/config/config.go similarity index 100% rename from src/internal/config/config.go rename to app/internal/config/config.go diff --git a/src/internal/handler/pinghandler.go b/app/internal/handler/pinghandler.go similarity index 75% rename from src/internal/handler/pinghandler.go rename to app/internal/handler/pinghandler.go index 465f298..34b8354 100644 --- a/src/internal/handler/pinghandler.go +++ b/app/internal/handler/pinghandler.go @@ -3,10 +3,10 @@ package handler import ( "net/http" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/logic" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" "github.com/zeromicro/go-zero/rest/httpx" - "src/internal/logic" - "src/internal/svc" - "src/internal/types" ) // Ping the server to check if it's alive diff --git a/src/internal/handler/routes.go b/app/internal/handler/routes.go similarity index 92% rename from src/internal/handler/routes.go rename to app/internal/handler/routes.go index d88bb2b..7076a7d 100644 --- a/src/internal/handler/routes.go +++ b/app/internal/handler/routes.go @@ -6,7 +6,7 @@ package handler import ( "net/http" - "src/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" "github.com/zeromicro/go-zero/rest" ) diff --git a/src/internal/handler/steamlogincallbackhandler.go b/app/internal/handler/steamlogincallbackhandler.go similarity index 76% rename from src/internal/handler/steamlogincallbackhandler.go rename to app/internal/handler/steamlogincallbackhandler.go index ccb296c..08e7478 100644 --- a/src/internal/handler/steamlogincallbackhandler.go +++ b/app/internal/handler/steamlogincallbackhandler.go @@ -3,9 +3,9 @@ package handler import ( "net/http" - "src/internal/logic" - "src/internal/svc" - "src/internal/types" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/logic" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/src/internal/handler/steamlogininithandler.go b/app/internal/handler/steamlogininithandler.go similarity index 75% rename from src/internal/handler/steamlogininithandler.go rename to app/internal/handler/steamlogininithandler.go index 419c760..26ca820 100644 --- a/src/internal/handler/steamlogininithandler.go +++ b/app/internal/handler/steamlogininithandler.go @@ -3,9 +3,9 @@ package handler import ( "net/http" - "src/internal/logic" - "src/internal/svc" - "src/internal/types" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/logic" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/src/internal/logic/pinglogic.go b/app/internal/logic/pinglogic.go similarity index 81% rename from src/internal/logic/pinglogic.go rename to app/internal/logic/pinglogic.go index 392321b..117d606 100644 --- a/src/internal/logic/pinglogic.go +++ b/app/internal/logic/pinglogic.go @@ -3,8 +3,8 @@ package logic import ( "context" - "src/internal/svc" - "src/internal/types" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/src/internal/logic/steamlogincallbacklogic.go b/app/internal/logic/steamlogincallbacklogic.go similarity index 96% rename from src/internal/logic/steamlogincallbacklogic.go rename to app/internal/logic/steamlogincallbacklogic.go index a6c6135..86970ad 100644 --- a/src/internal/logic/steamlogincallbacklogic.go +++ b/app/internal/logic/steamlogincallbacklogic.go @@ -7,9 +7,9 @@ import ( "net/url" "time" - "src/internal/svc" - "src/internal/types" - "src/internal/utils/steamauth" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/utils/steamauth" "github.com/golang-jwt/jwt/v4" "github.com/zeromicro/go-zero/core/logx" diff --git a/src/internal/logic/steamlogininitlogic.go b/app/internal/logic/steamlogininitlogic.go similarity index 89% rename from src/internal/logic/steamlogininitlogic.go rename to app/internal/logic/steamlogininitlogic.go index 57c49e6..e9a4f81 100644 --- a/src/internal/logic/steamlogininitlogic.go +++ b/app/internal/logic/steamlogininitlogic.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "src/internal/svc" - "src/internal/types" - "src/internal/utils/steamauth" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/svc" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/types" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/utils/steamauth" "github.com/google/uuid" "github.com/zeromicro/go-zero/core/logx" diff --git a/src/internal/svc/servicecontext.go b/app/internal/svc/servicecontext.go similarity index 81% rename from src/internal/svc/servicecontext.go rename to app/internal/svc/servicecontext.go index 2e9e8f0..bdc5749 100644 --- a/src/internal/svc/servicecontext.go +++ b/app/internal/svc/servicecontext.go @@ -1,7 +1,7 @@ package svc import ( - "src/internal/config" + "git.cialloo.com/CiallooWeb/Authenticator/app/internal/config" "github.com/zeromicro/go-zero/core/stores/redis" ) diff --git a/src/internal/types/types.go b/app/internal/types/types.go similarity index 100% rename from src/internal/types/types.go rename to app/internal/types/types.go diff --git a/src/internal/utils/steamauth/steamopenid.go b/app/internal/utils/steamauth/steamopenid.go similarity index 100% rename from src/internal/utils/steamauth/steamopenid.go rename to app/internal/utils/steamauth/steamopenid.go diff --git a/src/go.mod b/go.mod similarity index 94% rename from src/go.mod rename to go.mod index bd9c853..8ecb022 100644 --- a/src/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ -module src +module git.cialloo.com/CiallooWeb/Authenticator go 1.24.4 require ( github.com/golang-jwt/jwt/v4 v4.5.2 github.com/google/uuid v1.6.0 - github.com/zeromicro/go-zero v1.9.1 + github.com/zeromicro/go-zero v1.9.2 ) require ( @@ -29,7 +29,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/redis/go-redis/v9 v9.15.0 // indirect + github.com/redis/go-redis/v9 v9.14.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect diff --git a/src/go.sum b/go.sum similarity index 97% rename from src/go.sum rename to go.sum index 8e556a2..1077ae1 100644 --- a/src/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/redis/go-redis/v9 v9.15.0 h1:2jdes0xJxer4h3NUZrZ4OGSntGlXp4WbXju2nOTRXto= -github.com/redis/go-redis/v9 v9.15.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= +github.com/redis/go-redis/v9 v9.14.0 h1:u4tNCjXOyzfgeLN+vAZaW1xUooqWDqVEsZN0U01jfAE= +github.com/redis/go-redis/v9 v9.14.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -86,8 +86,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -github.com/zeromicro/go-zero v1.9.1 h1:GZCl4jun/ZgZHnSvX3SSNDHf+tEGmEQ8x2Z23xjHa9g= -github.com/zeromicro/go-zero v1.9.1/go.mod h1:bHOl7Xr7EV/iHZWEqsUNJwFc/9WgAMrPpPagYvOaMtY= +github.com/zeromicro/go-zero v1.9.2 h1:ZXOXBIcazZ1pWAMiHyVnDQ3Sxwy7DYPzjE89Qtj9vqM= +github.com/zeromicro/go-zero v1.9.2/go.mod h1:k8YBMEFZKjTd4q/qO5RCW+zDgUlNyAs5vue3P4/Kmn0= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= diff --git a/script/goctl/GenApi.ps1 b/script/goctl/GenApi.ps1 index 875dac4..8831dce 100644 --- a/script/goctl/GenApi.ps1 +++ b/script/goctl/GenApi.ps1 @@ -17,7 +17,7 @@ Set-Location -Path (Resolve-Path "../../api") goctl api format -dir . # generate go-zero code -goctl api go -api Authenticator.api -dir ../src --style=gozero +goctl api go -api Authenticator.api -dir ../app --style=gozero # generate swagger and convert to openapi3 only when -s is provided if ($s) {