-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
30 lines (26 loc) · 831 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"google.golang.org/grpc/reflection"
api "github.com/Wattpad/TaskManager/api/task_manager"
"github.com/Wattpad/TaskManager/internal/config"
"github.com/Wattpad/TaskManager/pkg/service"
"github.com/Wattpad/TaskManager/pkg/storage"
"github.com/Wattpad/wsl"
"github.com/Wattpad/wsl/grpc"
"github.com/Wattpad/wsl/sql"
)
// EntryPoint is typically where you will, for instance, attach HTTP
// handlers to a router or register a GRPC API implementation with a server.
func EntryPoint(grpcServer *grpc.Server, taskService *service.Service) {
api.RegisterTaskServiceServer(grpcServer, taskService)
reflection.Register(grpcServer)
}
func main() {
wsl.New[config.Config]("TaskManager",
EntryPoint,
grpc.ServerModule,
service.NewService,
sql.Module("taskmanager"),
storage.NewStorage,
).Run()
}