Esempio n. 1
0
func NewServer(protoAddr, transport string, app types.Application) (Service, error) {
	var s Service
	var err error
	switch transport {
	case "socket":
		s, err = NewSocketServer(protoAddr, app)
	case "grpc":
		s, err = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
	default:
		err = fmt.Errorf("Unknown server type %s", transport)
	}
	return s, err
}
Esempio n. 2
0
func TestGRPC(t *testing.T) {
	fmt.Println("### Testing GRPC")
	testGRPCSync(t, types.NewGRPCApplication(nilapp.NewNilApplication()))
}