This directory contains two example implementations of a simple echo service using different IDL formats:
- Go 1.20 or later
- For installation instructions, see Go’s Getting Started guide.
- For Cap'n Proto example setup, see capnp-gen-arpc documentation
- For Protocol Buffers example setup, see protoc-gen-arpc documentation
A simple echo service implementation using Cap'n Proto as the IDL format. The service accepts text content and echoes it back.
- Define service in
echo.capnp - Generate Go code using
capnp-gen-arpc - Run server:
go run server/server.go - Run client:
go run frontend/frontend.go - Test:
curl http://localhost:8080?key=hello
A simple echo service implementation using Protocol Buffers as the IDL format. The service accepts a message and echoes it back.
- Define service in
echo.proto - Generate Go code:
protoc --go_out=. --arpc_out=. echo/proto/echo.proto - Run server:
go run server/server.go - Run client:
go run frontend/frontend.go - Test:
curl http://localhost:8080?key=hello
Both examples demonstrate how to:
- Define service interfaces using different IDL formats
- Generate client/server code
- Implement and run a basic RPC service
- Test the service using HTTP endpoints