Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileRestore ¶
type FileRestore struct { Options RestoreOptions // contains filtered or unexported fields }
FileRestore reads records from a file
func (*FileRestore) Init ¶
func (f *FileRestore) Init(opts ...RestoreOption) error
type FileSnapshot ¶
type FileSnapshot struct { Options SnapshotOptions // contains filtered or unexported fields }
FileSnapshot backs up incoming records to a File
func (*FileSnapshot) Init ¶
func (f *FileSnapshot) Init(opts ...SnapshotOption) error
Init validates the options
func (*FileSnapshot) Start ¶
func (f *FileSnapshot) Start() (chan<- *store.Record, error)
Start opens a channel which receives *store.Record and writes them to storage
func (*FileSnapshot) Wait ¶
func (f *FileSnapshot) Wait()
Wait waits for the snapshotter to commit the backups to persistent storage
type Restore ¶
type Restore interface { // Init validates the RestoreOptions and returns an error if they are invalid. // Init must be called before a Restore is used Init(opts ...RestoreOption) error // Start opens a channel over which records from the snapshot are retrieved. // The channel will be closed when the entire snapshot has been read. Start() (<-chan *store.Record, error) }
Restore emits records from a go-micro store snapshot
func NewFileRestore ¶
func NewFileRestore(opts ...RestoreOption) Restore
type RestoreOption ¶
type RestoreOption func(r *RestoreOptions)
RestoreOption is an individual option
func Source ¶
func Source(source string) RestoreOption
Source is the source URL of a snapshot, e.g. file:///path/to/file
type RestoreOptions ¶
type RestoreOptions struct {
Source string
}
RestoreOptions configure a Restore
type Snapshot ¶
type Snapshot interface { // Init validates the Snapshot options and returns an error if they are invalid. // Init must be called before the Snapshot is used Init(opts ...SnapshotOption) error // Start opens a channel that receives *store.Record, adding any incoming records to a backup // close() the channel to commit the results. Start() (chan<- *store.Record, error) // Wait waits for any operations to be committed to underlying storage Wait() }
Snapshot creates snapshots of a go-micro store
func NewFileSnapshot ¶
func NewFileSnapshot(opts ...SnapshotOption) Snapshot
NewFileSnapshot returns a FileSnapshot
type SnapshotOption ¶
type SnapshotOption func(s *SnapshotOptions)
SnapshotOption is an individual option
func Destination ¶
func Destination(dest string) SnapshotOption
Destination is the URL to snapshot to, e.g. file:///path/to/file
type SnapshotOptions ¶
type SnapshotOptions struct {
Destination string
}
SnapshotOptions configure a snapshotter