Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

add dart grpc #61

Open
ghost opened this issue Sep 6, 2018 · 1 comment
Open

add dart grpc #61

ghost opened this issue Sep 6, 2018 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented Sep 6, 2018

Would you be open to adding dart grpc ?

Its now quite mature, and also gettign grpc-web soon.
I typically use it to do grpc between golang servers and dart clients in flutter.

REPO: https://github.com/grpc/grpc-dart

Tutorial: https://grpc.io/docs/tutorials/basic/dart.html

Here is the tutorial using a Makefile for golang and dart talking over grpc.

# Get golang server and dart client talking over grpc.

# dart Walkthrough : https://grpc.io/docs/tutorials/basic/dart.html
# go equivalent: https://github.com/grpc/grpc-go/tree/master/examples/route_guide

DART_LIBPATH=github.com/grpc/grpc-dart
DART_LIBGOPATH=$(GOPATH)/src/$(DART_LIBPATH)

GO_LIBPATH=google.golang.org/grpc
GO_LIBGOPATH=$(GOPATH)/src/$(GO_LIBPATH)


print:
	@echo 
	@echo DART_LIBPATH $(DART_LIBPATH)
	@echo DART_LIBGOPATH $(DART_LIBGOPATH)
	@echo 
	@echo GO_LIBPATH $(GO_LIBPATH)
	@echo GO_LIBGOPATH $(GO_LIBGOPATH)

dep-os:
	#go get golang.org/x/mobile/cmd/gomobile
	#gomobile init # it might take a few minutes

	# get the dart protoc plugin
	pub global activate protoc_plugin

dep:
	go get -u $(GO_LIBPATH)
	go get -u $(DART_LIBPATH)


dep-clean:
	rm -rf $(DART_LIBGOPATH)
	rm -rf $(GO_LIBGOPATH)


## Golang stuff


go-open-code:
	code $(GO_LIBGOPATH)/examples/route_guide

go-build:
	#cd $(GO_LIBGOPATH)/examples/route_guide && protoc -I protos/ routeguide/route_guide.proto --go_out=grpc:routeguide/generated

	cd $(GO_LIBGOPATH)/examples/route_guide/server && go generate

go-run-server:
	cd $(GO_LIBGOPATH)/examples/route_guide/server && go run server.go -json_db_file $(GO_LIBGOPATH)/examples/route_guide/testdata/route_guide_db.json -port 8080 -tls=true

go-run-client:
	cd $(GO_LIBGOPATH)/examples/route_guide/client && go run client.go -server_addr 127.0.0.1:8080 -tls=true



## Flutter stuff

dart-open-code:
	code $(DART_LIBGOPATH)

dart-build:
	cd $(DART_LIBGOPATH)/example/route_guide && pub get

	# gen dart server
	cd $(DART_LIBGOPATH)/example/route_guide && protoc -I protos/ protos/route_guide.proto --dart_out=grpc:lib/src/generated

	# gen golang server
	#cd $(DART_LIBGOPATH)/example/route_guide && protoc -I protos/ protos/route_guide.proto --go_out=grpc:go/generated


dart-run-server:
	# run server
	cd $(DART_LIBGOPATH)/example/route_guide && dart bin/server.dart

dart-run-client:
	# run server
	cd $(DART_LIBGOPATH)/example/route_guide && dart bin/client.dart -tls=true
	

ft-build-ios:
	# do this to bootstrap IOS befroe you start coding.
	cd caddy/example && flutter build ios --no-codesign

ft-open-ios:
	# open xcode proj.
	open caddy/example/ios/Runner.xcworkspace

ft-run-ios:
	cd caddy/example && flutter run






```



@supermuka
Copy link

supermuka commented Feb 16, 2019

Would be nice to have full dart lang too. On Dart client and Dart server (VM) sides.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants