RPC 框架 Go-MOA
- 授权协议: 未知
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/blackbeans/go-moa
- 软件文档: https://github.com/blackbeans/go-moa/blob/master/README.md
- 官方下载: https://github.com/blackbeans/go-moa/archive/master.zip
软件介绍
MOA Server使用方式
安装:
安装ZooKeeper $Zookeeper/bin/zkServer.sh start
go get github.com/blackbeans/go-moa/core go get github.com/blackbeans/go-moa/proxy
定义服务的接口对应
//接口 type DemoResult struct { Hosts []string `json:"hosts"` Uri string `json:"uri"` } type IGoMoaDemo interface { GetDemoName(serviceUri, proto string) (DemoResult, error) } //服务实现 type GoMoaDemo struct { } func (self GoMoaDemo) GetDemoName(serviceUri, proto string) (DemoResult, error) { return DemoResult{[]string{"fuck gfw"}, serviceUri}, nil }例如接口为:
服务端启动启动:
func main(){ app := core.NewApplcation("./conf/cluster_test.toml", func() []proxy.Service { return []proxy.Service{ proxy.Service{ ServiceUri: "/service/bibi/go-moa", Instance: GoMoaDemo{}, Interface: (*IGoMoaDemo)(nil)}} }) //设置启动项 ch := make(chan os.Signal, 1) signal.Notify(ch, os.Kill) //kill掉的server <-ch app.DestoryApplication() }说明
Service为一个服务单元,对应了本服务对外的服务名称、以及对应的接口
Applcation需要对应的Moa的配置文件,toml类型,具体配置参见./conf/cluster_test.toml
发布服务成功可以使用客户端进行测试,具体客户端的使用请参考
*** Benchmark
env:Macbook Pro 2.2 GHz Intel Core i7 go test --bench=".*" github.com/blackbeans/go-moa/core -run=BenchmarkApplication BenchmarkApplication-8 20000 64517 ns/op
Google成功的七堂课
罗耀宗 / 电子工业出版社 / 2005-7 / 28.00元
Google是全球使用人数最多的搜索引擎,在短短几年内,Google从斯坦福大学的实验室,茁壮成长为举世瞩目的IT业超级巨人,他们的成功绝非偶然,尤其是在网络泡沫破灭,行业一片萧条之际,它的崛起更为IT业带来一缕曙光。作者从趋势观察家的角度,以讲座的形式,向读者讲述Google成功的关键因素:破除因循守旧、不断打破常规,核心技术领先、做出了“更好的捕鼠器”,使得Google在搜索技术方面远远超越对......一起来看看 《Google成功的七堂课》 这本书的介绍吧!
