Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
rpcx
✓ github.com/smallnest/rpcx
Starts an RPCX server with a simple arithmetic service.
package main
import (
"context"
"github.com/smallnest/rpcx/server"
)
type Args struct {
A int
B int
}
type Reply struct {
C int
}
type Arith struct{}
func (t *Arith) Mul(ctx context.Context, args *Args, reply *Reply) error {
reply.C = args.A * args.B
return nil
}
func main() {
s := server.NewServer()
s.RegisterName("Arith", new(Arith), "")
s.Serve("tcp", ":8972")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.9.3latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.