From 8b001fe9fe33d5283b0b00fe7e094844e8ac66de Mon Sep 17 00:00:00 2001 From: Greg Tyler Date: Fri, 8 Dec 2023 14:48:40 +0000 Subject: [PATCH] Move `lambda/shared` to `internal/shared` To make clear that it isn't a lambda itself, and to align more closely with other OPG Go repos' structure. #patch --- Makefile | 2 +- {lambda => internal}/shared/client.go | 0 {lambda => internal}/shared/date.go | 0 {lambda => internal}/shared/date_test.go | 0 {lambda => internal}/shared/ddb.go | 0 {lambda => internal}/shared/event.go | 0 {lambda => internal}/shared/jwt.go | 0 {lambda => internal}/shared/jwt_test.go | 0 {lambda => internal}/shared/lpa.go | 0 {lambda => internal}/shared/person.go | 0 {lambda => internal}/shared/problem.go | 0 {lambda => internal}/shared/update.go | 0 lambda/Dockerfile | 2 +- lambda/create/main.go | 2 +- lambda/create/validate.go | 2 +- lambda/create/validate_test.go | 2 +- lambda/get/main.go | 2 +- lambda/update/main.go | 2 +- renovate.json | 2 +- 19 files changed, 8 insertions(+), 8 deletions(-) rename {lambda => internal}/shared/client.go (100%) rename {lambda => internal}/shared/date.go (100%) rename {lambda => internal}/shared/date_test.go (100%) rename {lambda => internal}/shared/ddb.go (100%) rename {lambda => internal}/shared/event.go (100%) rename {lambda => internal}/shared/jwt.go (100%) rename {lambda => internal}/shared/jwt_test.go (100%) rename {lambda => internal}/shared/lpa.go (100%) rename {lambda => internal}/shared/person.go (100%) rename {lambda => internal}/shared/problem.go (100%) rename {lambda => internal}/shared/update.go (100%) diff --git a/Makefile b/Makefile index 7ec7e9ba..1d76d21c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ down: ## Stop application docker compose down test: ## Unit tests - go test ./lambda/get/... ./lambda/create/... ./lambda/update/... ./lambda/shared/... -race -covermode=atomic -coverprofile=coverage.out + go test ./lambda/get/... ./lambda/create/... ./lambda/update/... ./internal/shared/... -race -covermode=atomic -coverprofile=coverage.out test-api: URL ?= http://localhost:9000 test-api: diff --git a/lambda/shared/client.go b/internal/shared/client.go similarity index 100% rename from lambda/shared/client.go rename to internal/shared/client.go diff --git a/lambda/shared/date.go b/internal/shared/date.go similarity index 100% rename from lambda/shared/date.go rename to internal/shared/date.go diff --git a/lambda/shared/date_test.go b/internal/shared/date_test.go similarity index 100% rename from lambda/shared/date_test.go rename to internal/shared/date_test.go diff --git a/lambda/shared/ddb.go b/internal/shared/ddb.go similarity index 100% rename from lambda/shared/ddb.go rename to internal/shared/ddb.go diff --git a/lambda/shared/event.go b/internal/shared/event.go similarity index 100% rename from lambda/shared/event.go rename to internal/shared/event.go diff --git a/lambda/shared/jwt.go b/internal/shared/jwt.go similarity index 100% rename from lambda/shared/jwt.go rename to internal/shared/jwt.go diff --git a/lambda/shared/jwt_test.go b/internal/shared/jwt_test.go similarity index 100% rename from lambda/shared/jwt_test.go rename to internal/shared/jwt_test.go diff --git a/lambda/shared/lpa.go b/internal/shared/lpa.go similarity index 100% rename from lambda/shared/lpa.go rename to internal/shared/lpa.go diff --git a/lambda/shared/person.go b/internal/shared/person.go similarity index 100% rename from lambda/shared/person.go rename to internal/shared/person.go diff --git a/lambda/shared/problem.go b/internal/shared/problem.go similarity index 100% rename from lambda/shared/problem.go rename to internal/shared/problem.go diff --git a/lambda/shared/update.go b/internal/shared/update.go similarity index 100% rename from lambda/shared/update.go rename to internal/shared/update.go diff --git a/lambda/Dockerfile b/lambda/Dockerfile index aa06ab53..26afab18 100644 --- a/lambda/Dockerfile +++ b/lambda/Dockerfile @@ -6,7 +6,7 @@ COPY ./go.sum /app/go.sum RUN go mod download -COPY ./lambda/shared /app/lambda/shared +COPY ./internal/shared /app/internal/shared ARG DIR COPY ./lambda/$DIR /app/lambda/$DIR diff --git a/lambda/create/main.go b/lambda/create/main.go index dcd0ab0c..197a4ac6 100644 --- a/lambda/create/main.go +++ b/lambda/create/main.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" "github.com/ministryofjustice/opg-go-common/logging" ) diff --git a/lambda/create/validate.go b/lambda/create/validate.go index 596214c2..d5b878cd 100644 --- a/lambda/create/validate.go +++ b/lambda/create/validate.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" ) func validateAddress(address shared.Address, prefix string, errors []shared.FieldError) []shared.FieldError { diff --git a/lambda/create/validate_test.go b/lambda/create/validate_test.go index 704ca661..6cb8f400 100644 --- a/lambda/create/validate_test.go +++ b/lambda/create/validate_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" "github.com/stretchr/testify/assert" ) diff --git a/lambda/get/main.go b/lambda/get/main.go index 8e499524..c9cc7e47 100644 --- a/lambda/get/main.go +++ b/lambda/get/main.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" "github.com/ministryofjustice/opg-go-common/logging" ) diff --git a/lambda/update/main.go b/lambda/update/main.go index 9b57d9f4..0a2def0d 100644 --- a/lambda/update/main.go +++ b/lambda/update/main.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" "github.com/go-openapi/jsonpointer" - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" "github.com/ministryofjustice/opg-go-common/logging" ) diff --git a/renovate.json b/renovate.json index 350567cc..05094ea8 100644 --- a/renovate.json +++ b/renovate.json @@ -14,7 +14,7 @@ { "description": "Ignore internal dependency upgrades - Renovate doesn't recognise that these are relative and therefore don't need to refer to the correct digest", "matchPackageNames": [ - "github.com/ministryofjustice/opg-data-lpa-store/lambda/shared" + "github.com/ministryofjustice/opg-data-lpa-store/internal/shared" ], "enabled": false },