diff --git a/src/internal/connector/sharepoint/collection.go b/src/internal/connector/sharepoint/collection.go new file mode 100644 index 000000000..d8bcf2cc6 --- /dev/null +++ b/src/internal/connector/sharepoint/collection.go @@ -0,0 +1,54 @@ +package sharepoint + +import ( + "io" + + "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/support" + "github.com/alcionai/corso/src/internal/data" + "github.com/alcionai/corso/src/pkg/path" +) + +type DataCategory int + +//go:generate stringer -type=DataCategory +const ( + Unknown DataCategory = iota + List + Drive +) + +var ( + _ data.Collection = &Collection{} + _ data.Stream = &Item{} +) + +type Collection struct { + data chan data.Stream + // folderPath indicates the hierarchy within the collection + folderPath path.Path + // M365 IDs of the items of this collection + service graph.Service + statusUpdater support.StatusUpdater +} + +func (sc *Collection) FullPath() path.Path { + return sc.FullPath() +} + +func (sc *Collection) Items() <-chan data.Stream { + return sc.data +} + +type Item struct { + id string + data io.ReadCloser +} + +func (sd *Item) UUID() string { + return sd.id +} + +func (sd *Item) ToReader() io.ReadCloser { + return sd.data +} diff --git a/src/internal/connector/sharepoint/datacategory_string.go b/src/internal/connector/sharepoint/datacategory_string.go new file mode 100644 index 000000000..7f75d5846 --- /dev/null +++ b/src/internal/connector/sharepoint/datacategory_string.go @@ -0,0 +1,25 @@ +// Code generated by "stringer -type=DataCategory"; DO NOT EDIT. + +package sharepoint + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Unknown-0] + _ = x[List-1] + _ = x[Drive-2] +} + +const _DataCategory_name = "UnknownListDrive" + +var _DataCategory_index = [...]uint8{0, 7, 11, 16} + +func (i DataCategory) String() string { + if i < 0 || i >= DataCategory(len(_DataCategory_index)-1) { + return "DataCategory(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _DataCategory_name[_DataCategory_index[i]:_DataCategory_index[i+1]] +}