echo_capnp

module
v0.0.0-...-64bc6a5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0

README

1. Define your .capnp file

Create echo.capnp:

@0xbf5147bb3b06fa3d;

using Go = import "/go.capnp";

$Go.package("echo_capnp");
$Go.import("github.com/appnet-org/arpc/examples/echo_capnp/capnp");

struct EchoRequest {
  content @0 :Text;
}

struct EchoResponse {
  content @0 :Text;
}

interface EchoService {
  echo @0 (req :EchoRequest) -> (resp :EchoResponse);
}

2. Generate Go code

See capnp-gen-arpc for details.

3. Run the client and server

Start the server:

go run server/server.go

In a separate terminal, run the client:

go run frontend/frontend.go frontend/metrics.go

4. Test

curl http://localhost:8080?key=hello

Directories

Path Synopsis
Code generated by capnp-gen-arpc.
Code generated by capnp-gen-arpc.

Jump to

Keyboard shortcuts

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