cuckoo RPC support many codecs, if you use Protocol Buffers codec, you can generate contract codes from Protocol Buffers service definition files with protoc-gen-cuckoo.
Use go get
to install the code generator:
go install github.com/carolove/protoc-gen-cuckoo
You will also need:
- protoc, the protobuf compiler. You need version 3+.
- github.com/golang/protobuf/protoc-gen-go, the Go protobuf generator plugin. Get this with
go get
.
Just like grpc:
protoc --go_out=. --cuckoo_out=. hello.proto
Service interfaces and client proxies were generated into a separate file [name].cuckoo.go
:
hello.cuckoo.go
hello.pb.go
hello.proto