Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPLoader ¶
HTTPLoader provides a source for restoring a backup from a URL. The contained http client is used for the request.
func (HTTPLoader) Load ¶
func (h HTTPLoader) Load(ctx context.Context) (io.ReadCloser, error)
Load a backup set from the URL in the http loader. Returns the response body as a stream.
type ID ¶
type ID string
ID of a backup
func (ID) Cancel ¶
func (id ID) Cancel()
Status returns the status of the jobState with the id. Returns nil if the jobState cannot be found.
type Loader ¶
type Loader interface {
Load(ctx context.Context) (io.ReadCloser, error)
}
Loader provides a source for loading a backup set.
type Request ¶
type Request struct { DB *rankdb.Manager Cancel context.CancelFunc Dst Saver Lists rankdb.ListIDs ErrCh <-chan error }
Request is a request to start a backup on certain lists on a DB to a Saver.
type RestoreInfo ¶
type RestoreInfo struct { // Source to read the data. Source Loader // Destinatio DB where lists should be stored. DB *rankdb.Manager // Replace existing lists. Replace bool // Cache assiciated with the DB. Cache rankdb.Cache // ListIDPrefix contains a prefix to apply to all lists. ListIDPrefix string // ListIDPrefix contains a suffix to apply to all lists. ListIDSuffix string }
RestoreInfo contains restoration info.
func (*RestoreInfo) Restore ¶
func (ri *RestoreInfo) Restore(ctx context.Context) (*RestoreResult, error)
Restore a backup set. 'ri' should contain all needed information.
type RestoreResult ¶
RestoreResult is the result of a restore operation that completed.
type Saver ¶
type Saver interface {
Save(ctx context.Context) (io.WriteCloser, error)
}
Saver provides a destination for saving a backup.
type Status ¶
type Status struct { // Custom information provided by backup Custom map[string]string // URI of backed up content. Used for restore. Done bool // Failed operations, indexed by list IDs Errors map[string]string // Number of lists to be backed up Lists int // Number of lists done. ListsDone int // Size of stored data Size int64 // Storage used for backup Storage string // Successful operations, list IDs Success []string Cancelled bool Started time.Time Finished *time.Time }
type WrapReader ¶
type WrapReader struct {
io.ReadCloser
}
WrapReader will wrap an io.Reader so it can be used for restoring a backup.
func (WrapReader) Load ¶
func (h WrapReader) Load(ctx context.Context) (io.ReadCloser, error)
Load will return the wrapped ReadCloser.