From bc045e41eca461182220447eaafb8b9c93abd002 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Fri, 4 Oct 2024 13:37:42 -0400 Subject: [PATCH] refactor: move packages under internal Signed-off-by: Chris Gianelloni --- cmd/tx-submit-api-mirror/main.go | 8 ++++---- {api => internal/api}/api.go | 6 +++--- {api => internal/api}/api_test.go | 16 +++++++++++++++- {config => internal/config}/config.go | 2 +- {logging => internal/logging}/logging.go | 4 ++-- 5 files changed, 25 insertions(+), 11 deletions(-) rename {api => internal/api}/api.go (96%) rename {api => internal/api}/api_test.go (70%) rename {config => internal/config}/config.go (98%) rename {logging => internal/logging}/logging.go (94%) diff --git a/cmd/tx-submit-api-mirror/main.go b/cmd/tx-submit-api-mirror/main.go index 8158d04..2b51e14 100644 --- a/cmd/tx-submit-api-mirror/main.go +++ b/cmd/tx-submit-api-mirror/main.go @@ -1,4 +1,4 @@ -// Copyright 2023 Blink Labs Software +// Copyright 2024 Blink Labs Software // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ import ( _ "go.uber.org/automaxprocs" - "github.com/blinklabs-io/tx-submit-api-mirror/api" - "github.com/blinklabs-io/tx-submit-api-mirror/config" - "github.com/blinklabs-io/tx-submit-api-mirror/logging" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/api" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/config" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/logging" ) var cmdlineFlags struct { diff --git a/api/api.go b/internal/api/api.go similarity index 96% rename from api/api.go rename to internal/api/api.go index 282740d..97373fe 100644 --- a/api/api.go +++ b/internal/api/api.go @@ -1,4 +1,4 @@ -// Copyright 2023 Blink Labs Software +// Copyright 2024 Blink Labs Software // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ import ( ginzap "github.com/gin-contrib/zap" "github.com/gin-gonic/gin" - "github.com/blinklabs-io/tx-submit-api-mirror/config" - "github.com/blinklabs-io/tx-submit-api-mirror/logging" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/config" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/logging" ) func Start(cfg *config.Config) error { diff --git a/api/api_test.go b/internal/api/api_test.go similarity index 70% rename from api/api_test.go rename to internal/api/api_test.go index 85207e4..4a3f32e 100644 --- a/api/api_test.go +++ b/internal/api/api_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api import ( @@ -6,7 +20,7 @@ import ( "testing" "time" - "github.com/blinklabs-io/tx-submit-api-mirror/config" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/config" ) func TestHTTPClientTimeout(t *testing.T) { diff --git a/config/config.go b/internal/config/config.go similarity index 98% rename from config/config.go rename to internal/config/config.go index 54bd462..e79cf62 100644 --- a/config/config.go +++ b/internal/config/config.go @@ -1,4 +1,4 @@ -// Copyright 2023 Blink Labs Software +// Copyright 2024 Blink Labs Software // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/logging/logging.go b/internal/logging/logging.go similarity index 94% rename from logging/logging.go rename to internal/logging/logging.go index 500f112..9c6edd0 100644 --- a/logging/logging.go +++ b/internal/logging/logging.go @@ -1,4 +1,4 @@ -// Copyright 2023 Blink Labs Software +// Copyright 2024 Blink Labs Software // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" - "github.com/blinklabs-io/tx-submit-api-mirror/config" + "github.com/blinklabs-io/tx-submit-api-mirror/internal/config" ) type Logger = zap.SugaredLogger