proto + grpc handler
This commit is contained in:
parent
a72002540d
commit
37041fc8fe
15 changed files with 942 additions and 14 deletions
27
cmd/main.go
27
cmd/main.go
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue