examples/

directory
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: BSD-3-Clause

README

jsonrpc2 API examples

These examples are small command packages that exercise public go.lsp.dev/jsonrpc2 APIs. They are covered by go test ./examples/... and can also be run directly with go run.

Example What it demonstrates Run
peer A bidirectional in-process peer pair using NewChannelStreamPair, NewPeer, Call, and Notify. go run ./examples/peer
serve A loopback server using HandlerServer, Serve, and a client NewStream over net.Conn. go run ./examples/serve
batch A raw-frame batch client using NewBatchClient, AppendBatch, calls, and notifications. go run ./examples/batch

Directories

Path Synopsis
Command batch demonstrates sending one raw JSON-RPC batch frame.
Command batch demonstrates sending one raw JSON-RPC batch frame.
Command peer demonstrates a bidirectional in-process JSON-RPC connection.
Command peer demonstrates a bidirectional in-process JSON-RPC connection.
Command serve demonstrates serving JSON-RPC requests over a loopback listener.
Command serve demonstrates serving JSON-RPC requests over a loopback listener.

Jump to

Keyboard shortcuts

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