2017-05-24 06:31:30 +00:00
|
|
|
package server
|
2017-05-23 10:08:11 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
pb "loafle.com/overflow/overflow_api_service/grpc"
|
|
|
|
"loafle.com/overflow/overflow_gateway_service/gateway"
|
|
|
|
)
|
|
|
|
|
2017-05-24 06:31:30 +00:00
|
|
|
func RunRpc() error {
|
2017-05-23 10:08:11 +00:00
|
|
|
l, err := net.Listen("tcp", ":9090")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
s := grpc.NewServer()
|
|
|
|
|
|
|
|
pb.RegisterOverflowGatewayServer(s, &gateway.ServiceImpl{})
|
|
|
|
s.Serve(l)
|
|
|
|
|
|
|
|
return nil
|
2017-05-24 06:31:30 +00:00
|
|
|
}
|