// 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 }
func (r *registry) Save() ([]byte, error) { r.m.RLock() defer r.m.RUnlock() glog.V(2).Info("registry saved") return bhgob.Encode(r) }