clair/vendor/github.com/grpc-ecosystem/grpc-gateway/examples/server/main.go
2017-06-13 15:58:11 -04:00

26 lines
538 B
Go

package server
import (
"net"
examples "github.com/grpc-ecosystem/grpc-gateway/examples/examplepb"
"google.golang.org/grpc"
)
func Run() error {
l, err := net.Listen("tcp", ":9090")
if err != nil {
return err
}
s := grpc.NewServer()
examples.RegisterEchoServiceServer(s, newEchoServer())
examples.RegisterFlowCombinationServer(s, newFlowCombinationServer())
abe := newABitOfEverythingServer()
examples.RegisterABitOfEverythingServiceServer(s, abe)
examples.RegisterStreamServiceServer(s, abe)
s.Serve(l)
return nil
}