overflow_gateway_service/server/rpc.go

23 lines
375 B
Go
Raw Normal View History

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
}