Protobuf-RPC实现 protorpc
- 授权协议: BSD
- 开发语言: C/C++ Google Go
- 操作系统: 跨平台
- 软件首页: https://code.google.com/p/protorpc/
- 软件文档: http://godoc.org/code.google.com/p/protorpc
软件介绍
针对Go语言和C++的Protobuf-RPC实现. 其中C++版本还附加了XML的支持.
示例代码:
package server
import (
"code.google.com/p/goprotobuf/proto"
"errors"
"./arith.pb"
)
type Arith int
func (t *Arith) Multiply(args *arith.ArithRequest, reply *arith.ArithResponse) error {
reply.Val = proto.Int32(args.GetA() * args.GetB())
return nil
}
func (t *Arith) Divide(args *arith.ArithRequest, reply *arith.ArithResponse) error {
if args.GetB() == 0 {
return errors.New("divide by zero")
}
reply.Quo = proto.Int32(args.GetA() / args.GetB())
reply.Rem = proto.Int32(args.GetA() % args.GetB())
return nil
}
func main() {
arith.ListenAndServeArithService("tcp", ":1984", new(Arith))
}
JSON 在线解析
在线 JSON 格式化工具
RGB HSV 转换
RGB HSV 互转工具
