Exemplo n.º 1
0
// storeDescFromGossip retrieves a StoreDescriptor from the specified
// store gossip key. Returns an error if the gossip doesn't exist
// or is not a StoreDescriptor.
func storeDescFromGossip(key string, g *gossip.Gossip) (*proto.StoreDescriptor, error) {
	storeDesc := &proto.StoreDescriptor{}
	if err := g.GetInfoProto(key, storeDesc); err != nil {
		return nil, err
	}
	return storeDesc, nil
}