示例#1
0
文件: node.go 项目: jyzhe/beehive
// MustEncode encodes the hive into bytes.
func (i GroupNode) MustEncode() []byte {
	b, err := bhgob.Encode(i)
	if err != nil {
		glog.Fatalf("error in encoding peer: %v", err)
	}
	return b
}
示例#2
0
文件: registry.go 项目: jyzhe/beehive
func (r *registry) Save() ([]byte, error) {
	r.m.RLock()
	defer r.m.RUnlock()
	glog.V(2).Info("registry saved")
	return bhgob.Encode(r)
}