kubernetes/vendor/go.etcd.io/etcd/server/v3/etcdserver/api/snap/snapshotter.go

const snapSuffix

var ErrNoSnapshot

var ErrEmptySnapshot

var ErrCRCMismatch

var crcTable

var validFiles

type Snapshotter

func New(lg *zap.Logger, dir string) *Snapshotter {}

func (s *Snapshotter) SaveSnap(snapshot raftpb.Snapshot) error {}

func (s *Snapshotter) save(snapshot *raftpb.Snapshot) error {}

// Load returns the newest snapshot.
func (s *Snapshotter) Load() (*raftpb.Snapshot, error) {}

// LoadNewestAvailable loads the newest snapshot available that is in walSnaps.
func (s *Snapshotter) LoadNewestAvailable(walSnaps []walpb.Snapshot) (*raftpb.Snapshot, error) {}

// loadMatching returns the newest snapshot where matchFn returns true.
func (s *Snapshotter) loadMatching(matchFn func(*raftpb.Snapshot) bool) (*raftpb.Snapshot, error) {}

func loadSnap(lg *zap.Logger, dir, name string) (*raftpb.Snapshot, error) {}

// Read reads the snapshot named by snapname and returns the snapshot.
func Read(lg *zap.Logger, snapname string) (*raftpb.Snapshot, error) {}

// snapNames returns the filename of the snapshots in logical time order (from newest to oldest).
// If there is no available snapshots, an ErrNoSnapshot will be returned.
func (s *Snapshotter) snapNames() ([]string, error) {}

func checkSuffix(lg *zap.Logger, names []string) []string {}

// cleanupSnapdir removes any files that should not be in the snapshot directory:
// - db.tmp prefixed files that can be orphaned by defragmentation
func (s *Snapshotter) cleanupSnapdir(filenames []string) (names []string, err error) {}

func (s *Snapshotter) ReleaseSnapDBs(snap raftpb.Snapshot) error {}