arpc 用于根据 .service 文件生成 ARPC 的客户端/服务端包装代码。
go install github.com/lesismal/arpc/cmd/arpc@latest
package myservice import "github.com/your/module/types" service HelloService { Hello(string) (string, error) Add(*string, int) (*string, error) go AsyncProcess(types.Request) (types.Response, error) Notify(types.Event) }
arpc -out ./gen -package myservice -test hello.service
/<Service>.<Method>。ServiceMethodRequest 结构体并通过 Context.Bind 解析。(T, error) 或无返回值。go 前缀表示服务端异步处理(注册时设置 async=true)。