func (s *MemoryStorage) Snapshot() (raftpb.Snapshot, error) {
	return raftpb.Snapshot{}, nil
}
Snapshot do not support
package storage
import (
	"os"
	"github.com/coreos/etcd/raft"
	"github.com/coreos/etcd/raft/raftpb"
	"github.com/flike/kingbus/log"
	"github.com/flike/kingbus/utils"
)
type MemoryStorage struct {
	MetaStorage
	memDB *raft.MemoryStorage
}
func NewMemoryStorage(dir string) (*MemoryStorage, error) {
	var err error
	if len(dir) == 0 {
		return nil, ErrArgsIllegal
	}
	if utils.DirExist(dir) == false {
		err = os.MkdirAll(dir, DirMode)
		if err != nil {
			return nil, err
		}
	}
	s := new(MemoryStorage)
	s.memDB = raft.NewMemoryStorage()
	s.MetaStorage, err = NewMetaStore(dir)
	if err != nil {
		log.Log.Errorf("NewMemoryStorage:NewMetaStorage error,err:%s,dir:%s", err.Error(), dir)
		return nil, err
	}
	return s, nil
}
func (s *MemoryStorage) Entries(lo, hi, maxSize uint64) ([]raftpb.Entry, error) {
	entries, err := s.memDB.Entries(lo, hi, maxSize)
	if err != nil {
		log.Log.Errorf("MemoryStorage:entries error,err:%s,lo:%d,hi:%d,maxSize:%d",
			err.Error(), lo, hi, maxSize)
		return nil, err
	}
	return entries, nil
}
func (s *MemoryStorage) Term(i uint64) (uint64, error) {
	term, err := s.memDB.Term(i)
	if err != nil {
		log.Log.Errorf("MemoryStorage:Term error,err:%s,i:%d",
			err.Error(), i)
		return 0, err
	}
	return term, nil
}
func (s *MemoryStorage) LastIndex() (uint64, error) {
	lastIndex, err := s.memDB.LastIndex()
	if err != nil {
		log.Log.Errorf("MemoryStorage:LastIndex error,err:%s", err.Error())
		return 0, err
	}
	return lastIndex, nil
}
func (s *MemoryStorage) FirstIndex() (uint64, error) {
	firstIndex, err := s.memDB.FirstIndex()
	if err != nil {
		log.Log.Errorf("MemoryStorage:FirstIndex error,err:%s", err.Error())
		return 0, err
	}
	return firstIndex, nil
}