From f39a14eda3f2ec45d3bc2bf4d8bd5b54b63390d3 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 23 Sep 2022 10:17:59 -0400 Subject: [PATCH] GC: const variables extended to include default container names (#886) ## Description Moves constants to a file and adds more source definitions and backgrounds to constants. ## Type of change - [x] :hamster: Trivial/Minor ## Issue(s) *closes #823 ## Test Plan Const variables to be used in future PRs. No tests are available. - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .../connector/exchange/exchange_vars.go | 17 +++++++++++++++++ .../connector/exchange/mail_folder_cache.go | 13 ------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/internal/connector/exchange/exchange_vars.go b/src/internal/connector/exchange/exchange_vars.go index 3274a4ae4..9302875b0 100644 --- a/src/internal/connector/exchange/exchange_vars.go +++ b/src/internal/connector/exchange/exchange_vars.go @@ -31,7 +31,18 @@ const ( // Default Folder Names //------------------------ // Mail Definitions: https://docs.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0 + + // inbox and root + DefaultMailFolder = "Inbox" + rootFolderAlias = "msgfolderroot" DefaultContactFolder = "Contacts" + DefaultCalendar = "Calendar" + + //--------------------- + // Paging + //----------------- + // nextDataLink definition https://docs.microsoft.com/en-us/graph/paging + nextDataLink = "@odata.nextLink" ) // descendable represents objects that implement msgraph-sdk-go/models.entityable @@ -47,3 +58,9 @@ type displayable interface { GetId() *string GetDisplayName() *string } + +// container is an interface that implements both the descendable and displayble interface. +type container interface { + descendable + displayable +} diff --git a/src/internal/connector/exchange/mail_folder_cache.go b/src/internal/connector/exchange/mail_folder_cache.go index b1824e94d..7fe9aac33 100644 --- a/src/internal/connector/exchange/mail_folder_cache.go +++ b/src/internal/connector/exchange/mail_folder_cache.go @@ -12,19 +12,6 @@ import ( "github.com/alcionai/corso/src/internal/path" ) -const ( - // rootFolderAlias is the per-user root container alias for the exchange email - // hierarchy. - rootFolderAlias = "msgfolderroot" - // nextDataLink is a random map key so we can iterate through delta results. - nextDataLink = "@odata.nextLink" -) - -type container interface { - descendable - displayable -} - // cachedContainer is used for local unit tests but also makes it so that this // code can be broken into generic- and service-specific chunks later on to // reuse logic in IDToPath.