overflow_gateway_service/server/rpc.go

23 lines
383 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"
2017-05-29 11:32:23 +00:00
pb "git.loafle.net/overflow/overflow_api_service/grpc"
"git.loafle.net/overflow/overflow_gateway_service/gateway"
2017-05-23 10:08:11 +00:00
)
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
}