Documentation
¶
Overview ¶
Package main internal/rpcgen/main.go c4-vis-cli
Command rpcgen writes reflection-free gobrpc handlers for a net/rpc receiver. TinyGo's reflect has no Value.Call or Type.Method, so the same generated handlers serve both the Go and the TinyGo build.
Usage:
go run ./internal/rpcgen -type T=registerT[,U=registerU] -o x_rpc.go
It reads the package in -dir (default ".") as each build in targets sees it, fails unless they all agree on the methods of *T that net/rpc would register, and writes func registerT(s *rpc.Server, name string, r *T) error, which calls s.HandleCall(name+".Method", ...) for each method. The argument is decoded on the read loop and the method runs in its own goroutine, as with net/rpc.
Click to show internal directories.
Click to hide internal directories.