corso/src/internal/data/data_collection.go
Keepers 6cdc691c6f
correct the corso module (#749)
swaps the corso go module from github.com/
alcionai/corso to github.com/alcionai/corso/src
to align with the location of the go.mod and
go.sum files inside the repo.

All other changes in the repository update the
package imports to the new module path.
2022-09-07 15:50:54 -06:00

38 lines
1.2 KiB
Go

package data
import (
"io"
"github.com/alcionai/corso/src/pkg/backup/details"
)
// A Collection represents a compilation of data from the
// same type application (e.g. mail)
type Collection interface {
// Items returns a channel from which items in the collection can be read.
// Each returned struct contains the next item in the collection
// The channel is closed when there are no more items in the collection or if
// an unrecoverable error caused an early termination in the sender.
Items() <-chan Stream
// FullPath returns a slice of strings that act as metadata tags for this
// DataCollection. Returned items should be ordered from most generic to least
// generic. For example, a DataCollection for emails from a specific user
// would be {"<tenant id>", "<user ID>", "emails"}.
FullPath() []string
}
// DataStream represents a single item within a DataCollection
// that can be consumed as a stream (it embeds io.Reader)
type Stream interface {
// ToReader returns an io.Reader for the DataStream
ToReader() io.ReadCloser
// UUID provides a unique identifier for this data
UUID() string
}
// DataStreamInfo is used to provide service specific
// information about the DataStream
type StreamInfo interface {
Info() details.ItemInfo
}