v2.3.0
A large release: performance, four transports, clients, batches, server push, observability, and JSON-RPC 2.0 spec compliance.
Highlights
Performance
- Inline dispatch — no goroutine + channel +
selectper request; config moved fromRWMutexto an atomic copy-on-write snapshot. Single dispatch 3.7 µs → 1.0 µs, 25 → 18 allocs (Apple M3), faster than a hand-rolledencoding/jsondispatcher. - DoS-safe batch defaults (
DefaultMaxBatchSize= 100, bounded concurrency).
Spec compliance
- Notifications (execute, no response), raw byte-exact
structs.ID(no float64 rounding),-32700parse errors, per-entry batch decoding, whitespace tolerance.
Server API
- Middleware (
Use), per-method timeouts (WithTimeout), OpenRPC 1.3.2 generation from the introspectable registry, observability hook (SetObserver).
Transports
jsonrpchttp(net/http) andjsonrpcws(WebSocket, built oncoder/websocket) with server push.- Fiber v2/v3 adapters as separate nested modules so Fiber/fasthttp stay out of the core
go.mod.
Clients
Caller/CallResult[R]and batchCallBatch/BatchResultAs[R]over both HTTP and WebSocket, with id correlation and streamed batch decoding.
json/v2 readiness
- All generic JSON routes through one
internal/codecseam; the switch toencoding/json/v2(≈ Go 1.27) is a one-file change. Still builds on Go 1.25+ with no build flags — no behavior change.
Install
go get github.com/gumeniukcom/golang-jsonrpc2/v2@v2.3.0
# Fiber adapters (separate modules, released alongside):
go get github.com/gumeniukcom/golang-jsonrpc2/jsonrpcfiber@v0.1.0 # Fiber v2
go get github.com/gumeniukcom/golang-jsonrpc2/jsonrpcfiberv3@v0.1.0 # Fiber v3Full details in CHANGELOG.md.
Full Changelog: v2.2.0...v2.3.0