目录
caohui2年前3次提交
目录readme.md
syntax = "proto3";

option go_package = "helloword";

package helloworld;

service Greeter {
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

message HelloRequest {
  string name = 1;
}

message HelloReply {
  string message = 1;
}

安装工生成工具

go get github.com/rpcxio/protoc-gen-gogorpcx/protoc-gen-gofast

生成

protoc --gofast_out=plugins=rpcx:. myproto.proto

启动服务和客户端

go run hello/main.go
go run rpc_server/server1/server.go
go run rpc_server/server2/server.go
go run rpc_server/server3/server.go

访问

http://localhost:8000/rpc-hello?name=word
http://localhost:8000/rpc?a=17&b=123
关于

gin_rpcx

15.1 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号