func (c *RaftCluster) SaveToStorage() error {
	value, err := json.Marshal(c)
	if err != nil {
		return err
	}
	key := utils.StringToBytes(storage.RaftClusterKey)
	err = c.Store.Set(key, value)
	if err != nil {
		log.Log.Panic("SaveToStorage error,err:%s,c:%v", err.Error(), *c)
	}
	return nil
}
SaveToStorage implements save the raft cluster information into storage
package membership
import (
	"bytes"
	"context"
	"crypto/sha1"
	"encoding/binary"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"sort"
	"strings"
	"sync"
	"time"
	"errors"
	"github.com/coreos/etcd/pkg/netutil"
	"github.com/coreos/etcd/pkg/types"
	"github.com/coreos/etcd/raft"
	"github.com/coreos/etcd/raft/raftpb"
	"github.com/flike/kingbus/log"
	"github.com/flike/kingbus/storage"
	"github.com/flike/kingbus/utils"
)
type RaftCluster struct {
	ID    types.ID        `json:"id"`
	Store storage.Storage `json:"-"`
	sync.Mutex `json:"-"`
	MembersMap map[types.ID]*Member `json:"members_map"`
	RemovedMap map[types.ID]bool `json:"removed_map"`
}
func GetRaftClusterFromStorage(s storage.Storage) (*RaftCluster, error) {
	var r RaftCluster
	value, err := s.Get(utils.StringToBytes(storage.RaftClusterKey))
	if err != nil {
		log.Log.Panicf("get storeMembers should never fail: %s", err)
	}
	if value == nil {
		return nil, storage.ErrKeyNotFound
	}
	err = json.Unmarshal(value, &r)
	if err != nil {
		log.Log.Panicf("json unmarshal should never fail,err:%s,value:%v", err, value)
	}
	return &r, nil
}