proto + grpc handler

This commit is contained in:
nquidox 2025-10-20 22:21:55 +03:00
parent a72002540d
commit 37041fc8fe
15 changed files with 942 additions and 14 deletions

View file

@ -1,14 +1,37 @@
package main
import (
"context"
log "github.com/sirupsen/logrus"
"imageStorage/config"
"imageStorage/internal/app"
"imageStorage/internal/convert"
"imageStorage/internal/mainHandler"
"os"
"os/signal"
"syscall"
)
func main() {
c := config.NewConfig()
//c := config.DevConfig()
config.LogSetup(c.App.LogLevel)
log.Infof("Log level: %s", c.App.LogLevel)
a := app.NewApp()
a.Start()
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()
converter := convert.NewHandler()
imageServerHandler := mainHandler.NewHandler(mainHandler.Deps{
Converter: converter,
})
a := app.NewApp(app.Deps{
Config: c,
GrpcServer: imageServerHandler,
})
if err := a.Start(ctx); err != nil {
log.Fatal(err)
}
}