Categorygithub.com/automenu/echo-grpc
repository
0.0.0-20241229181812-2376ec593888
Repository: https://github.com/automenu/echo-grpc.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

echo-grpc

The echo-grpc is a tiny gRPC service that echos what you start it with!

The service is built with Connect. Its API uses Protocol Buffers, and the service supports the gRPC, gRPC-Web, and Connect protocol.

Getting started

Prerequisites

Start the server

# Resolve Go dependencies
go mod tidy

# Start the server
make dev

Make request

In a separate terminal window, in the root working directory, hit the API using the generated client:

make ping

If you have a recent version of cURL installed, you can make a HTTP/1.1 POST request with a JSON payload.

curl \
    --header "Content-Type: application/json" \
    --data '{"message": "Hello, testing gRPC over HTTP..."}' \
    http://localhost:8080/echo.v1.EchoAPI/Echo

If you have a recent version of gRPCurl installed, you can make gRPC requests without using a generated client.

grpcurl \
    -protoset <(buf build -o -) -plaintext \
    -d '{"message": "Hello, testing gRPC using gRPCurl..."}' \
    localhost:8080 echo.v1.EchoAPI/Echo