MCPcopy Index your code
hub / github.com/connectrpc/examples-go

github.com/connectrpc/examples-go @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
82 symbols 159 edges 7 files 31 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

examples-go

Build

examples-go contains an example RPC service built with Connect. Its API is defined by a Protocol Buffer schema, and the service supports the gRPC, gRPC-Web, and Connect protocols.

The service emulates the DOCTOR script written for Joseph Weizenbaum's 1966 ELIZA natural language processing system. It responds to your statements as a stereotypical psychotherapist might; since the original program was a demonstration of the superficiality of human-computer communication, the therapy is not very convincing.

For more on Connect, see the announcement blog post, the documentation on connectrpc.com, or the Connect repo.

Example

The service is running on https://demo.connectrpc.com. To make an RPC with cURL, using the Connect protocol:

curl --header "Content-Type: application/json" \
    --data '{"sentence": "I feel happy."}' \
    https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say

To make the same RPC, but using grpcurl and the gRPC protocol:

grpcurl \
    -d '{"sentence": "I feel happy."}' \
    demo.connectrpc.com:443 \
    connectrpc.eliza.v1.ElizaService/Say

Legal

Offered under the Apache 2 license.

Extension points exported contracts — how you extend this code

ElizaServiceClient (Interface)
ElizaServiceClient is a client for the connectrpc.eliza.v1.ElizaService service. [3 implementers]
internal/gen/connectrpc/eliza/v1/elizav1connect/eliza.connect.go
ElizaServiceHandler (Interface)
ElizaServiceHandler is an implementation of the connectrpc.eliza.v1.ElizaService service. [3 implementers]
internal/gen/connectrpc/eliza/v1/elizav1connect/eliza.connect.go

Core symbols most depended-on inside this repo

Reply
called by 8
internal/eliza/eliza.go
randomElementFrom
called by 4
internal/eliza/eliza.go
NewElizaServiceClient
called by 2
internal/gen/connectrpc/eliza/v1/elizav1connect/eliza.connect.go
NewElizaServiceHandler
called by 2
internal/gen/connectrpc/eliza/v1/elizav1connect/eliza.connect.go
NewElizaServer
called by 2
cmd/demoserver/main.go
GetIntroResponses
called by 1
internal/eliza/eliza.go
lookupResponse
called by 1
internal/eliza/eliza.go
preprocess
called by 1
internal/eliza/eliza.go

Shape

Method 51
Function 19
Struct 10
Interface 2

Languages

Go100%

Modules by API surface

internal/gen/connectrpc/eliza/v1/eliza.pb.go46 symbols
internal/gen/connectrpc/eliza/v1/elizav1connect/eliza.connect.go18 symbols
cmd/demoserver/main.go7 symbols
internal/eliza/eliza.go6 symbols
internal/eliza/eliza_test.go4 symbols
cmd/demoserver/main_test.go1 symbols

For agents

$ claude mcp add examples-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact