All checks were successful
dev test / test (push) Successful in 17s
dev test / vulnCheck (push) Successful in 30s
dev test / Ci-Lint (push) Successful in 19s
${{ github.actor }} executed Build Push Prod / build (push) Successful in 4m24s
${{ github.actor }} executed Build Push Prod / deploy (push) Successful in 18s
33 lines
914 B
Go
33 lines
914 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"git.maximotejeda.com/maximo/dolar/config"
|
|
"git.maximotejeda.com/maximo/dolar/internal/adapter/db"
|
|
"git.maximotejeda.com/maximo/dolar/internal/adapter/grpc"
|
|
"git.maximotejeda.com/maximo/dolar/internal/adapter/nats"
|
|
"git.maximotejeda.com/maximo/dolar/internal/application/core/api"
|
|
)
|
|
|
|
func main() {
|
|
log := slog.Default()
|
|
log.With("adapter", "main")
|
|
natsAdapter, err := nats.NewAdapter(config.GetNatsServiceUrl())
|
|
if err != nil {
|
|
log.Error("failed to connect to nats.", "error", err)
|
|
}
|
|
|
|
dbAdapter, err := db.NewAdapter(config.GetDataSourceURL(), natsAdapter)
|
|
if err != nil {
|
|
|
|
log.Error("failed to connect to database.", "error", err)
|
|
panic(err)
|
|
}
|
|
|
|
application := api.NewApplication(dbAdapter)
|
|
grpcAdapter := grpc.NewAdapter(application, config.GetApplicationPort())
|
|
log.Info("grpc server running", "port", config.GetApplicationPort())
|
|
grpcAdapter.Run()
|
|
}
|