export

package
v0.0.0-...-d9d993d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumeExportCollections

func ConsumeExportCollections(
	ctx context.Context,
	exportLocation string,
	expColl []Collectioner,
	errs *fault.Bus,
) error

Types

type BaseCollection

type BaseCollection struct {
	// BaseDir contains the destination path of the collection.
	BaseDir string

	// BackingCollection is the restore collection from which we will
	// create the export collection.
	BackingCollection []data.RestoreCollection

	// BackupVersion is the backupVersion of the data source.
	BackupVersion int

	Cfg control.ExportConfig

	Stream ItemStreamer

	Stats *metrics.ExportStats
}

BaseCollection holds the foundational details of an export collection.

func (BaseCollection) BasePath

func (bc BaseCollection) BasePath() string

func (BaseCollection) Items

func (bc BaseCollection) Items(ctx context.Context) <-chan Item

type Collectioner

type Collectioner interface {
	// BasePath gets the base path of the collection. This is derived
	// from FullPath, but trim out thing like drive id or any other part
	// that is not needed to show the path to the collection.
	BasePath() string

	// Items gets the items within the collection(folder)
	Items(context.Context) <-chan Item
}

Collectioner is the interface that is returned to the SDK consumer

type Item

type Item struct {
	// ID will be a unique id for the item. This is same as the id
	// that is used to store the data. This is not the name and is
	// mostly used just for tracking.
	ID string

	// Name is the name of the item. This is the name that the item
	// would have had in the service.
	Name string

	// Body is the body of the item. This is an io.ReadCloser and the
	// SDK consumer is responsible for closing it.
	Body io.ReadCloser

	// Error will contain any error that happened while trying to get
	// the item/items like when trying to resolve the name of the item.
	// In case we have the error bound to a particular item, we will
	// also return the id of the item.
	Error error
}

Item is the item that is returned to the SDK consumer

type ItemStreamer

type ItemStreamer func(
	ctx context.Context,
	backingColls []data.RestoreCollection,
	backupVersion int,
	cfg control.ExportConfig,
	ch chan<- Item,
	stats *metrics.ExportStats)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL