Repository: google/exposure-notifications-server
Pull request #309 (2020-05-15 23:44:46)

Restructure api directories to be under internal matching package name
First step towards #35 

google-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/google/exposure-notifications-server/pull/309#" title="Author self-approved">crwilcox</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=google%2Fexposure-notifications-server).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/google/exposure-notifications-server/blob/master/OWNERS)~~ [crwilcox]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
mikehelmick: /lgtm
/approve
google-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/google/exposure-notifications-server/pull/309#" title="Author self-approved">crwilcox</a>*, *<a href="https://github.com/google/exposure-notifications-server/pull/309#issuecomment-629560351" title="Approved">mikehelmick</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=google%2Fexposure-notifications-server).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/google/exposure-notifications-server/blob/master/OWNERS)~~ [crwilcox,mikehelmick]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
google-prow-robot: New changes are detected. LGTM label has been removed.
mikehelmick: /lgtm
/approve
google-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/google/exposure-notifications-server/pull/309#" title="Author self-approved">crwilcox</a>*, *<a href="https://github.com/google/exposure-notifications-server/pull/309#issuecomment-629568630" title="Approved">mikehelmick</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=google%2Fexposure-notifications-server).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/google/exposure-notifications-server/blob/master/OWNERS)~~ [crwilcox,mikehelmick]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/cmd/cleanup-export/main.go b/cmd/cleanup-export/main.go
index b721fe2..f934e3b 100644
--- a/cmd/cleanup-export/main.go
+++ b/cmd/cleanup-export/main.go
@@ -20,7 +20,7 @@ import (
 	"log"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/cleanup"
+	"github.com/google/exposure-notifications-server/internal/cleanup"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
diff --git a/cmd/cleanup-exposure/main.go b/cmd/cleanup-exposure/main.go
index d525897..32f1f15 100644
--- a/cmd/cleanup-exposure/main.go
+++ b/cmd/cleanup-exposure/main.go
@@ -20,7 +20,7 @@ import (
 	"log"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/cleanup"
+	"github.com/google/exposure-notifications-server/internal/cleanup"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
diff --git a/cmd/export/main.go b/cmd/export/main.go
index 7ef0144..9c52f58 100644
--- a/cmd/export/main.go
+++ b/cmd/export/main.go
@@ -20,7 +20,7 @@ import (
 	"log"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/export"
+	"github.com/google/exposure-notifications-server/internal/export"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
diff --git a/cmd/exposure/main.go b/cmd/exposure/main.go
index bc0fbec..dc6c06a 100644
--- a/cmd/exposure/main.go
+++ b/cmd/exposure/main.go
@@ -20,9 +20,9 @@ import (
 	"log"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/handlers"
-	"github.com/google/exposure-notifications-server/internal/api/publish"
+	"github.com/google/exposure-notifications-server/internal/handlers"
 	"github.com/google/exposure-notifications-server/internal/logging"
+	"github.com/google/exposure-notifications-server/internal/publish"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
 
diff --git a/cmd/federationin/main.go b/cmd/federationin/main.go
index 4e8ed43..1f069bc 100644
--- a/cmd/federationin/main.go
+++ b/cmd/federationin/main.go
@@ -21,7 +21,7 @@ import (
 	"log"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/federationin"
+	"github.com/google/exposure-notifications-server/internal/federationin"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
diff --git a/cmd/federationout/main.go b/cmd/federationout/main.go
index 32da149..5894ca7 100644
--- a/cmd/federationout/main.go
+++ b/cmd/federationout/main.go
@@ -23,7 +23,7 @@ import (
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/credentials"
 
-	"github.com/google/exposure-notifications-server/internal/api/federationout"
+	"github.com/google/exposure-notifications-server/internal/federationout"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/pb"
 	"github.com/google/exposure-notifications-server/internal/setup"
diff --git a/cmd/monolith/main.go b/cmd/monolith/main.go
index 639cd33..59e60d3 100644
--- a/cmd/monolith/main.go
+++ b/cmd/monolith/main.go
@@ -20,14 +20,14 @@ import (
 	"fmt"
 	"net/http"
 
-	"github.com/google/exposure-notifications-server/internal/api/cleanup"
-	"github.com/google/exposure-notifications-server/internal/api/export"
-	"github.com/google/exposure-notifications-server/internal/api/federationin"
-	"github.com/google/exposure-notifications-server/internal/api/handlers"
-	"github.com/google/exposure-notifications-server/internal/api/publish"
+	"github.com/google/exposure-notifications-server/internal/cleanup"
 	"github.com/google/exposure-notifications-server/internal/database"
 	"github.com/google/exposure-notifications-server/internal/dbapiconfig"
+	"github.com/google/exposure-notifications-server/internal/export"
+	"github.com/google/exposure-notifications-server/internal/federationin"
+	"github.com/google/exposure-notifications-server/internal/handlers"
 	"github.com/google/exposure-notifications-server/internal/logging"
+	"github.com/google/exposure-notifications-server/internal/publish"
 	"github.com/google/exposure-notifications-server/internal/setup"
 )
 
diff --git a/internal/api/cleanup/cleanup.go b/internal/cleanup/cleanup.go
similarity index 100%
rename from internal/api/cleanup/cleanup.go
rename to internal/cleanup/cleanup.go
diff --git a/internal/api/cleanup/cleanup_test.go b/internal/cleanup/cleanup_test.go
similarity index 100%
rename from internal/api/cleanup/cleanup_test.go
rename to internal/cleanup/cleanup_test.go
diff --git a/internal/api/cleanup/config.go b/internal/cleanup/config.go
similarity index 100%
rename from internal/api/cleanup/config.go
rename to internal/cleanup/config.go
diff --git a/internal/api/config/config.go b/internal/config/config.go
similarity index 100%
rename from internal/api/config/config.go
rename to internal/config/config.go
diff --git a/internal/dbapiconfig/apiconfig.go b/internal/dbapiconfig/apiconfig.go
index f41766f..7965b4f 100644
--- a/internal/dbapiconfig/apiconfig.go
+++ b/internal/dbapiconfig/apiconfig.go
@@ -20,7 +20,7 @@ import (
 	"sync"
 	"time"
 
-	provider "github.com/google/exposure-notifications-server/internal/api/config"
+	provider "github.com/google/exposure-notifications-server/internal/config"
 	"github.com/google/exposure-notifications-server/internal/database"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/model/apiconfig"
diff --git a/internal/api/export/batcher.go b/internal/export/batcher.go
similarity index 100%
rename from internal/api/export/batcher.go
rename to internal/export/batcher.go
diff --git a/internal/api/export/batcher_test.go b/internal/export/batcher_test.go
similarity index 100%
rename from internal/api/export/batcher_test.go
rename to internal/export/batcher_test.go
diff --git a/internal/api/export/config.go b/internal/export/config.go
similarity index 100%
rename from internal/api/export/config.go
rename to internal/export/config.go
diff --git a/internal/api/export/exportfile.go b/internal/export/exportfile.go
similarity index 100%
rename from internal/api/export/exportfile.go
rename to internal/export/exportfile.go
diff --git a/internal/api/export/server.go b/internal/export/server.go
similarity index 100%
rename from internal/api/export/server.go
rename to internal/export/server.go
diff --git a/internal/api/export/server_test.go b/internal/export/server_test.go
similarity index 100%
rename from internal/api/export/server_test.go
rename to internal/export/server_test.go
diff --git a/internal/api/export/worker.go b/internal/export/worker.go
similarity index 100%
rename from internal/api/export/worker.go
rename to internal/export/worker.go
diff --git a/internal/api/export/worker_test.go b/internal/export/worker_test.go
similarity index 100%
rename from internal/api/export/worker_test.go
rename to internal/export/worker_test.go
diff --git a/internal/api/federationin/config.go b/internal/federationin/config.go
similarity index 100%
rename from internal/api/federationin/config.go
rename to internal/federationin/config.go
diff --git a/internal/api/federationin/federationin.go b/internal/federationin/federationin.go
similarity index 100%
rename from internal/api/federationin/federationin.go
rename to internal/federationin/federationin.go
diff --git a/internal/api/federationin/federationin_test.go b/internal/federationin/federationin_test.go
similarity index 100%
rename from internal/api/federationin/federationin_test.go
rename to internal/federationin/federationin_test.go
diff --git a/internal/api/federationout/config.go b/internal/federationout/config.go
similarity index 100%
rename from internal/api/federationout/config.go
rename to internal/federationout/config.go
diff --git a/internal/api/federationout/federationout.go b/internal/federationout/federationout.go
similarity index 100%
rename from internal/api/federationout/federationout.go
rename to internal/federationout/federationout.go
diff --git a/internal/api/federationout/federationout_test.go b/internal/federationout/federationout_test.go
similarity index 100%
rename from internal/api/federationout/federationout_test.go
rename to internal/federationout/federationout_test.go
diff --git a/internal/api/handlers/delay.go b/internal/handlers/delay.go
similarity index 100%
rename from internal/api/handlers/delay.go
rename to internal/handlers/delay.go
diff --git a/internal/api/handlers/delay_test.go b/internal/handlers/delay_test.go
similarity index 100%
rename from internal/api/handlers/delay_test.go
rename to internal/handlers/delay_test.go
diff --git a/internal/api/jsonutil/unmarshal.go b/internal/jsonutil/unmarshal.go
similarity index 100%
rename from internal/api/jsonutil/unmarshal.go
rename to internal/jsonutil/unmarshal.go
diff --git a/internal/api/jsonutil/unmarshal_test.go b/internal/jsonutil/unmarshal_test.go
similarity index 100%
rename from internal/api/jsonutil/unmarshal_test.go
rename to internal/jsonutil/unmarshal_test.go
diff --git a/internal/api/publish/config.go b/internal/publish/config.go
similarity index 100%
rename from internal/api/publish/config.go
rename to internal/publish/config.go
diff --git a/internal/api/publish/publish.go b/internal/publish/publish.go
similarity index 97%
rename from internal/api/publish/publish.go
rename to internal/publish/publish.go
index 579a075..78d9353 100644
--- a/internal/api/publish/publish.go
+++ b/internal/publish/publish.go
@@ -21,9 +21,9 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/google/exposure-notifications-server/internal/api/config"
-	"github.com/google/exposure-notifications-server/internal/api/jsonutil"
+	"github.com/google/exposure-notifications-server/internal/config"
 	"github.com/google/exposure-notifications-server/internal/database"
+	"github.com/google/exposure-notifications-server/internal/jsonutil"
 	"github.com/google/exposure-notifications-server/internal/logging"
 	"github.com/google/exposure-notifications-server/internal/model"
 	"github.com/google/exposure-notifications-server/internal/serverenv"
diff --git a/internal/serverenv/env.go b/internal/serverenv/env.go
index 9b7f1ee..41719ac 100644
--- a/internal/serverenv/env.go
+++ b/internal/serverenv/env.go
@@ -20,7 +20,7 @@ import (
 	"crypto"
 	"fmt"
 
-	"github.com/google/exposure-notifications-server/internal/api/config"
+	"github.com/google/exposure-notifications-server/internal/config"
 	"github.com/google/exposure-notifications-server/internal/database"
 	"github.com/google/exposure-notifications-server/internal/metrics"
 	"github.com/google/exposure-notifications-server/internal/secrets"
diff --git a/tools/federationin-query/main.go b/tools/federationin-query/main.go
index e08a553..6175ffc 100644
--- a/tools/federationin-query/main.go
+++ b/tools/federationin-query/main.go
@@ -22,8 +22,8 @@ import (
 	"regexp"
 	"time"
 
-	"github.com/google/exposure-notifications-server/internal/api/federationin"
 	"github.com/google/exposure-notifications-server/internal/database"
+	"github.com/google/exposure-notifications-server/internal/federationin"
 	cflag "github.com/google/exposure-notifications-server/internal/flag"
 	"github.com/google/exposure-notifications-server/internal/model"
 	"github.com/kelseyhightower/envconfig"
diff --git a/tools/federationout-authorization/main.go b/tools/federationout-authorization/main.go
index 7304b34..d1c024f 100644
--- a/tools/federationout-authorization/main.go
+++ b/tools/federationout-authorization/main.go
@@ -21,8 +21,8 @@ import (
 	"flag"
 	"log"
 
-	"github.com/google/exposure-notifications-server/internal/api/federationin"
 	"github.com/google/exposure-notifications-server/internal/database"
+	"github.com/google/exposure-notifications-server/internal/federationin"
 	cflag "github.com/google/exposure-notifications-server/internal/flag"
 	"github.com/google/exposure-notifications-server/internal/model"
 	"github.com/kelseyhightower/envconfig"


Test patch:
diff --git a/tools/federationout-test/main.go b/tools/federationout-test/main.go
index 1cdb12e..6878ba4 100644
--- a/tools/federationout-test/main.go
+++ b/tools/federationout-test/main.go
@@ -22,7 +22,7 @@ import (
 	"log"
 	"time"
 
-	"github.com/google/exposure-notifications-server/internal/api/federationin"
+	"github.com/google/exposure-notifications-server/internal/federationin"
 	cflag "github.com/google/exposure-notifications-server/internal/flag"
 	"github.com/google/exposure-notifications-server/internal/pb"