Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.47 KB

File metadata and controls

39 lines (28 loc) · 1.47 KB

Echo Examples

This directory contains two example implementations of a simple echo service using different IDL formats:

Prerequisites

Echo Cap'n Proto Example (echo_capnp/)

A simple echo service implementation using Cap'n Proto as the IDL format. The service accepts text content and echoes it back.

Quick Start

  1. Define service in echo.capnp
  2. Generate Go code using capnp-gen-arpc
  3. Run server: go run server/server.go
  4. Run client: go run frontend/frontend.go
  5. Test: curl http://localhost:8080?key=hello

Echo Protocol Buffers Example (echo_proto/)

A simple echo service implementation using Protocol Buffers as the IDL format. The service accepts a message and echoes it back.

Quick Start

  1. Define service in echo.proto
  2. Generate Go code: protoc --go_out=. --arpc_out=. echo/proto/echo.proto
  3. Run server: go run server/server.go
  4. Run client: go run frontend/frontend.go
  5. 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