echo_proto

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 .proto file

Create echo.proto:

syntax = "proto3";

package pb;
option go_package = "./pb";

service EchoService {
    rpc Echo(EchoRequest) returns (EchoResponse);
}

message EchoRequest {
    string message = 1;
}

message EchoResponse {
    string message = 1;
}

2. Generate Go code

Run the following command to generate both Protobuf types and aRPC stubs:

protoc \
  --go_out=paths=source_relative:. \
  --arpc_out=paths=source_relative:. \
  proto/echo.proto

This will generate:

  • Standard Go types from Protobuf definitions (via protoc-gen-go)
  • aRPC client/server stubs (via protoc-gen-arpc) in *_arpc.pb.go

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

4. Test

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

Directories

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

Jump to

Keyboard shortcuts

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