Versions in this module Expand all Collapse all v3 v3.4.6 Mar 19, 2020 Changes in this version + var ErrCRCMismatch = errors.New("snap: crc mismatch") + var ErrEmptySnapshot = errors.New("snap: empty snapshot") + var ErrNoDBSnapshot = errors.New("snap: snapshot file doesn't exist") + var ErrNoSnapshot = errors.New("snap: no available snapshot") + func Read(lg *zap.Logger, snapname string) (*raftpb.Snapshot, error) + type Message struct + ReadCloser io.ReadCloser + TotalSize int64 + func NewMessage(rs raftpb.Message, rc io.ReadCloser, rcSize int64) *Message + func (m Message) CloseNotify() <-chan bool + func (m Message) CloseWithError(err error) + type Snapshotter struct + func New(lg *zap.Logger, dir string) *Snapshotter + func (s *Snapshotter) DBFilePath(id uint64) (string, error) + func (s *Snapshotter) Load() (*raftpb.Snapshot, error) + func (s *Snapshotter) SaveDBFrom(r io.Reader, id uint64) (int64, error) + func (s *Snapshotter) SaveSnap(snapshot raftpb.Snapshot) error