func NewFileSnapshot(opts ...SnapshotOption) Snapshot {
	f := &FileSnapshot{wg: &sync.WaitGroup{}}
	for _, o := range opts {
		o(&f.Options)
	}
	return f
}
NewFileSnapshot returns a FileSnapshot
package snapshot
import (
	"encoding/gob"
	"net/url"
	"os"
	"sync"
	"time"
	"github.com/micro/micro/v3/service/store"
	"github.com/pkg/errors"
)
type Snapshot interface {
	Init(opts ...SnapshotOption) error
	Start() (chan<- *store.Record, error)
	Wait()
}
type SnapshotOptions struct {
	Destination string
}
type SnapshotOption func(s *SnapshotOptions)
func Destination(dest string) SnapshotOption {
	return func(s *SnapshotOptions) {
		s.Destination = dest
	}
}
type FileSnapshot struct {
	Options SnapshotOptions
	records chan *store.Record
	path    string
	encoder *gob.Encoder
	file    *os.File
	wg      *sync.WaitGroup
}