From f85887483c2d8c593972c9098c95016830bfb7e3 Mon Sep 17 00:00:00 2001 From: Ginny Guan Date: Wed, 23 Oct 2024 17:06:42 +0800 Subject: [PATCH] refactor!: update module to v4 BREAKING CHANGE: import paths will need to change to v4 Signed-off-by: Ginny Guan --- go.mod | 4 ++-- go.sum | 4 ++-- internal/pkg/consul/client.go | 2 +- internal/pkg/consul/client_test.go | 2 +- internal/pkg/keeper/authinjector_test.go | 2 +- internal/pkg/keeper/client.go | 18 +++++++++--------- internal/pkg/keeper/client_test.go | 4 ++-- internal/pkg/keeper/consts.go | 2 +- internal/pkg/keeper/mock_keeper.go | 10 +++++----- pkg/types/config.go | 2 +- registry/factory.go | 6 +++--- registry/factory_test.go | 2 +- registry/interface.go | 2 +- registry/mocks/Client.go | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index d4473c5..c822a68 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ -module github.com/edgexfoundry/go-mod-registry/v3 +module github.com/edgexfoundry/go-mod-registry/v4 go 1.23 require ( - github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49 + github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.1 github.com/hashicorp/consul/api v1.29.4 github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index bf2f4fd..a1a19d7 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49 h1:uBI0nA3oO9P2MWBR1Tcn/543u4GFfWXd4J9Gii6CB1k= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.49/go.mod h1:MLk37/79M26+bZr3IptNZuYmQBEVbXwzDp1VHQkFhIk= +github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.1 h1:nAKgq3FZNyCLUxus5j+4pT0vcmT1I5+4MJCUAaD8Pg8= +github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.1/go.mod h1:I3EG+Tg/gcVSUJ+IJDuvVKFISnRu8oQtMXqltE1rzT8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= diff --git a/internal/pkg/consul/client.go b/internal/pkg/consul/client.go index f7dcc48..3dd4134 100644 --- a/internal/pkg/consul/client.go +++ b/internal/pkg/consul/client.go @@ -24,7 +24,7 @@ import ( consulapi "github.com/hashicorp/consul/api" - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) const ( diff --git a/internal/pkg/consul/client_test.go b/internal/pkg/consul/client_test.go index ea6e1b0..f03b8d8 100644 --- a/internal/pkg/consul/client_test.go +++ b/internal/pkg/consul/client_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) const ( diff --git a/internal/pkg/keeper/authinjector_test.go b/internal/pkg/keeper/authinjector_test.go index 8db1d0a..8e87d89 100644 --- a/internal/pkg/keeper/authinjector_test.go +++ b/internal/pkg/keeper/authinjector_test.go @@ -8,7 +8,7 @@ package keeper import ( "net/http" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/interfaces" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces" ) type emptyAuthenticationInjector struct { diff --git a/internal/pkg/keeper/client.go b/internal/pkg/keeper/client.go index e997ff3..1400e89 100644 --- a/internal/pkg/keeper/client.go +++ b/internal/pkg/keeper/client.go @@ -11,15 +11,15 @@ import ( "net/http" "strings" - httpClient "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/http" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/interfaces" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" - "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos" - dtoCommon "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/common" - "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/requests" - "github.com/edgexfoundry/go-mod-core-contracts/v3/models" - - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + httpClient "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/http" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" + "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos" + dtoCommon "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/common" + "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/requests" + "github.com/edgexfoundry/go-mod-core-contracts/v4/models" + + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) type keeperClient struct { diff --git a/internal/pkg/keeper/client_test.go b/internal/pkg/keeper/client_test.go index 7e34761..968163a 100644 --- a/internal/pkg/keeper/client_test.go +++ b/internal/pkg/keeper/client_test.go @@ -17,9 +17,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) const ( diff --git a/internal/pkg/keeper/consts.go b/internal/pkg/keeper/consts.go index 5a3fb8e..dd0451d 100644 --- a/internal/pkg/keeper/consts.go +++ b/internal/pkg/keeper/consts.go @@ -5,7 +5,7 @@ package keeper -import "github.com/edgexfoundry/go-mod-core-contracts/v3/common" +import "github.com/edgexfoundry/go-mod-core-contracts/v4/common" const ( ApiRegistrationByServiceIdRoute = common.ApiRegisterRoute + "/" + common.ServiceId + "/" diff --git a/internal/pkg/keeper/mock_keeper.go b/internal/pkg/keeper/mock_keeper.go index 992fde8..d03cd89 100644 --- a/internal/pkg/keeper/mock_keeper.go +++ b/internal/pkg/keeper/mock_keeper.go @@ -15,11 +15,11 @@ import ( "strings" "sync" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" - "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos" - dtoCommon "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/common" - "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/requests" - "github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/responses" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" + "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos" + dtoCommon "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/common" + "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/requests" + "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses" ) type MockKeeper struct { diff --git a/pkg/types/config.go b/pkg/types/config.go index 19830b5..13b724b 100644 --- a/pkg/types/config.go +++ b/pkg/types/config.go @@ -19,7 +19,7 @@ package types import ( "fmt" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/interfaces" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces" ) type GetAccessTokenCallback func() (string, error) diff --git a/registry/factory.go b/registry/factory.go index 62c34ce..8336564 100644 --- a/registry/factory.go +++ b/registry/factory.go @@ -20,9 +20,9 @@ package registry import ( "fmt" - "github.com/edgexfoundry/go-mod-registry/v3/internal/pkg/consul" - "github.com/edgexfoundry/go-mod-registry/v3/internal/pkg/keeper" - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/internal/pkg/consul" + "github.com/edgexfoundry/go-mod-registry/v4/internal/pkg/keeper" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) func NewRegistryClient(registryConfig types.Config) (Client, error) { diff --git a/registry/factory_test.go b/registry/factory_test.go index af37349..86e5f59 100644 --- a/registry/factory_test.go +++ b/registry/factory_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) var registryConfig = types.Config{ diff --git a/registry/interface.go b/registry/interface.go index 57b4bfa..ac6146c 100644 --- a/registry/interface.go +++ b/registry/interface.go @@ -17,7 +17,7 @@ package registry import ( - "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) type Client interface { diff --git a/registry/mocks/Client.go b/registry/mocks/Client.go index 29f8f0a..8ee0d6d 100644 --- a/registry/mocks/Client.go +++ b/registry/mocks/Client.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - types "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" + types "github.com/edgexfoundry/go-mod-registry/v4/pkg/types" ) // Client is an autogenerated mock type for the Client type