-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (33 loc) · 998 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
31
32
33
34
35
package main
import (
"fmt"
"github.com/tozastation/go-grpc-ddd-example/interfaces/di"
//"github.com/tozastation/go-grpc-ddd-example/interfaces/handler"
rpc_ping "github.com/tozastation/go-grpc-ddd-example/interfaces/rpc/ping"
//rpc_user "github.com/tozastation/go-grpc-ddd-example/interfaces/rpc/user"
rpc_weather "github.com/tozastation/go-grpc-ddd-example/interfaces/rpc/weather"
"log"
"net"
)
func main() {
listenPort, err := net.Listen("tcp", ":3001")
if err != nil {
log.Fatalln(err)
}
// Establish DB Connection
// handler.DB, err = handler.OpenDBConnection()
// if err != nil {
// panic(err)
// }
// Dependency Injection
server := di.InitializeServer()
weather := di.InitializeWeather()
ping := di.InitializePing()
//user := di.InitializeUser()
// register RPC
//rpc_user.RegisterUsersServer(server, user)
rpc_ping.RegisterCheckServer(server, ping)
rpc_weather.RegisterWeathersServer(server, weather)
fmt.Println("Listen on 3001")
server.Serve(listenPort)
}