From 25c781eec62811a32cbb6b21f7cb6ee2f76ecc69 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 25 Jul 2022 12:46:17 -0400 Subject: [PATCH] Gc edc extension (#402) * Extension of ExchangeDataCollection for async population. --- src/internal/connector/exchange_data_collection.go | 10 ++++++++-- src/internal/connector/graph_connector.go | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/internal/connector/exchange_data_collection.go b/src/internal/connector/exchange_data_collection.go index 5b3136f6b..45633bdfa 100644 --- a/src/internal/connector/exchange_data_collection.go +++ b/src/internal/connector/exchange_data_collection.go @@ -4,6 +4,7 @@ import ( "bytes" "io" + "github.com/alcionai/corso/internal/connector/support" "github.com/alcionai/corso/pkg/backup" ) @@ -53,8 +54,13 @@ var _ DataStreamInfo = &ExchangeData{} // It implements the DataCollection interface type ExchangeDataCollection struct { // M365 user - user string - data chan DataStream + user string + data chan DataStream + tasks []string + updateCh chan support.ConnectorOperationStatus + service graphService + populateFunc PopulateFunc + // FullPath is the slice representation of the action context passed down through the hierarchy. //The original request can be gleaned from the slice. (e.g. {, , "emails"}) fullPath []string diff --git a/src/internal/connector/graph_connector.go b/src/internal/connector/graph_connector.go index 7f02f7edd..d28b1b887 100644 --- a/src/internal/connector/graph_connector.go +++ b/src/internal/connector/graph_connector.go @@ -48,6 +48,8 @@ type graphService struct { failFast bool // if true service will exit sequence upon encountering an error } +type PopulateFunc func(context.Context, graphService, ExchangeDataCollection, chan *support.ConnectorOperationStatus) + func NewGraphConnector(acct account.Account) (*GraphConnector, error) { m365, err := acct.M365Config() if err != nil {