example/

directory
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT

README

generate go file

find ./proto -name "*.proto" -exec protoc --go_out=$GOPATH/src\
 --go-grpc_out=$GOPATH/src --go-grpc_opt=require_unimplemented_servers=false {} \;

or

protoc  --go_out=$GOPATH/src  --go-grpc_out=$GOPATH/src\
 --go-grpc_opt=require_unimplemented_servers=false \
   ./proto/*.proto  ./proto/another/*.proto  

Verify reflection interface

grpcurl -plaintext localhost:35001 list
grpcurl -plaintext localhost:35001 list SearchService
grpcurl -plaintext localhost:35001 describe SearchService.Search
grpcurl -plaintext localhost:35001 describe .SearchRequest

grpcurl -plaintext -format json -d '{
	"staffName": "zhangsan",
	"gender": true,
	"age": 10,
	"extra": {
		"jobTitle": "software engineer",
		"location": "Beijing",
		"department": "Back Office Department"
	}
}' localhost:35001 SearchService.Search

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL