Merge branch 'template-cleanup' into dev

This commit is contained in:
FernandoJVideira committed 2026-08-25 03:06:07 +01:00
commit 310c8f2211
71 files changed
+744 -743

No files matched your search

+15 -15
View File
@@ -15,15 +15,15 @@ import (
"github.com/rs/zerolog/log"
"golang.org/x/sync/errgroup"
"github.com/FernandoJVideira/simple_bank/internal/auth"
"github.com/FernandoJVideira/simple_bank/internal/config"
db "github.com/FernandoJVideira/simple_bank/internal/db/sqlc"
gapi "github.com/FernandoJVideira/simple_bank/internal/handlers/grpc"
api "github.com/FernandoJVideira/simple_bank/internal/handlers/http"
"github.com/FernandoJVideira/simple_bank/internal/mailer"
"github.com/FernandoJVideira/simple_bank/internal/service"
"github.com/FernandoJVideira/simple_bank/internal/worker"
"github.com/FernandoJVideira/simple_bank/pb"
"github.com/FernandoJVideira/api_tmpl/internal/auth"
"github.com/FernandoJVideira/api_tmpl/internal/config"
db "github.com/FernandoJVideira/api_tmpl/internal/db/sqlc"
gapi "github.com/FernandoJVideira/api_tmpl/internal/handlers/grpc"
api "github.com/FernandoJVideira/api_tmpl/internal/handlers/http"
"github.com/FernandoJVideira/api_tmpl/internal/mailer"
"github.com/FernandoJVideira/api_tmpl/internal/service"
"github.com/FernandoJVideira/api_tmpl/internal/worker"
"github.com/FernandoJVideira/api_tmpl/pb"
"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
@@ -36,7 +36,7 @@ import (
"google.golang.org/grpc/reflection"
"google.golang.org/protobuf/encoding/protojson"
_ "github.com/FernandoJVideira/simple_bank/docs/statik"
_ "github.com/FernandoJVideira/api_tmpl/docs/statik"
)
var interruptSignals = []os.Signal{
@@ -65,13 +65,13 @@ func NewApp(config config.Config, store db.Store, taskDistributor worker.TaskDis
}
}
// @title Simple Bank API
// @title API Template
// @version 1.0
// @description API for Simple Bank application
// @description Backend API template service
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.email support@simplebank.com
// @contact.email support@example.com
// @license.name MIT
// @license.url https://opensource.org/licenses/MIT
@@ -203,7 +203,7 @@ func runGrpcServer(ctx context.Context, wg *errgroup.Group, app *App) {
grpcLogger := grpc.UnaryInterceptor(gapi.GrpcLogger)
grpcServer := grpc.NewServer(grpcLogger)
pb.RegisterSimpleBankServer(grpcServer, server)
pb.RegisterApiTmplServer(grpcServer, server)
reflection.Register(grpcServer)
listener, err := net.Listen("tcp", app.config.GrpcServerAddr)
@@ -250,7 +250,7 @@ func runGatewayServer(ctx context.Context, wg *errgroup.Group, app *App) {
grpcMux := runtime.NewServeMux(opts)
err = pb.RegisterSimpleBankHandlerServer(ctx, grpcMux, server)
err = pb.RegisterApiTmplHandlerServer(ctx, grpcMux, server)
if err != nil {
log.Fatal().Err(err).Msg("cannot register handler server")
}