From f13a230a394e33dc1d1dfa761fd92df3fc120dfa Mon Sep 17 00:00:00 2001 From: bruce Date: Wed, 30 Oct 2024 14:59:49 +0800 Subject: [PATCH] refactor!: update module to v4 BREAKING CHANGE: update go module to v4 Signed-off-by: bruce --- .github/dependabot.yml | 8 ++++---- Attribution.txt | 22 +++++++++++----------- Dockerfile | 2 +- Makefile | 4 ++-- cmd/main.go | 2 +- go.mod | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- internal/driver/device.go | 10 +++++----- internal/driver/discover.go | 4 ++-- internal/driver/discover_test.go | 6 +++--- internal/driver/driver.go | 10 +++++----- internal/driver/driver_test.go | 6 +++--- internal/driver/logging.go | 2 +- 13 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c53ad447..91cdf21d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,13 +7,13 @@ updates: schedule: interval: "daily" ignore: - - dependency-name: "github.com/edgexfoundry/go-mod-core-contracts/v3" + - dependency-name: "github.com/edgexfoundry/go-mod-core-contracts/v4" # Included when device-sdk-go is updated - - dependency-name: "github.com/edgexfoundry/go-mod-messaging/v3" + - dependency-name: "github.com/edgexfoundry/go-mod-messaging/v4" # Included when device-sdk-go is updated - - dependency-name: "github.com/edgexfoundry/go-mod-registry/v3" + - dependency-name: "github.com/edgexfoundry/go-mod-registry/v4" # Included when device-sdk-go is updated - - dependency-name: "github.com/edgexfoundry/go-mod-secrets/v3" + - dependency-name: "github.com/edgexfoundry/go-mod-secrets/v4" # Included when device-sdk-go is updated - dependency-name: "github.com/edgexfoundry/go-mod-bootstrap/v3" # Included when device-sdk-go is updated diff --git a/Attribution.txt b/Attribution.txt index e0f15e2b..0d0b5ae7 100644 --- a/Attribution.txt +++ b/Attribution.txt @@ -6,14 +6,14 @@ https://github.com/cenkalti/backoff/blob/master/LICENSE edsrzf/mmap-go (BSD-3) https://github.com/edsrzf/mmap-go https://github.com/edsrzf/mmap-go/blob/master/LICENSE -edgexfoundry/go-mod-core-contracts/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-core-contracts/v3 -https://github.com/edgexfoundry/go-mod-core-contracts/v3/blob/master/LICENSE +edgexfoundry/go-mod-core-contracts/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-core-contracts/v4 +https://github.com/edgexfoundry/go-mod-core-contracts/v4/blob/master/LICENSE -edgexfoundry/go-mod-registry/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-registry/v3 +edgexfoundry/go-mod-registry/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-registry/v4 https://github.com/edgexfoundry/go-mod-registry/blob/master/LICENSE -edgexfoundry/device-sdk-go/v3 (Apache 2.0) https://github.com/edgexfoundry/device-sdk-go/v3 -https://github.com/edgexfoundry/device-sdk-go/v3/blob/master/LICENSE +edgexfoundry/device-sdk-go/v4 (Apache 2.0) https://github.com/edgexfoundry/device-sdk-go/v4 +https://github.com/edgexfoundry/device-sdk-go/v4/blob/master/LICENSE go-kit/kit (MIT) github.com/go-kit/kit https://github.com/go-kit/kit/blob/master/LICENSE @@ -111,14 +111,14 @@ https://github.com/OneOfOne/xxhash/blob/master/LICENCE hashicorp/consul/api (Mozilla Public License 2.0) https://github.com/hashicorp/consul/api https://github.com/hashicorp/consul/blob/master/LICENSE -edgexfoundry/go-mod-bootstrap/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-bootstrap/v3 -https://github.com/edgexfoundry/go-mod-bootstrap/v3/blob/master/LICENSE +edgexfoundry/go-mod-bootstrap/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-bootstrap/v4 +https://github.com/edgexfoundry/go-mod-bootstrap/v4/blob/master/LICENSE -edgexfoundry/go-mod-secret/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-secrets/v3 +edgexfoundry/go-mod-secret/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-secrets/v4 https://github.com/edgexfoundry/go-mod-secrets/blob/master/LICENSE -edgexfoundry/go-mod-configuration/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration/v3 -https://github.com/edgexfoundry/go-mod-configuration/v3/blob/master/LICENSE +edgexfoundry/go-mod-configuration/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration/v4 +https://github.com/edgexfoundry/go-mod-configuration/v4/blob/master/LICENSE fxamacker/cbor (MIT) https://github.com/fxamacker/cbor/v2 https://github.com/fxamacker/cbor/blob/master/LICENSE @@ -153,7 +153,7 @@ https://github.com/davecgh/go-spew/blob/master/LICENSE eclipse/paho.mqtt.golang (Eclipse Public License 2.0) https://github.com/eclipse/paho.mqtt.golang https://github.com/eclipse/paho.mqtt.golang/blob/master/LICENSE -edgexfoundry/go-mod-messaging/v3 (Apache 2.0) https://github.com/edgexfoundry/go-mod-messaging/v3 +edgexfoundry/go-mod-messaging/v4 (Apache 2.0) https://github.com/edgexfoundry/go-mod-messaging/v4 https://github.com/edgexfoundry/go-mod-messaging/blob/master/LICENSE github.com/fatih/color (MIT) https://github.com/fatih/color diff --git a/Dockerfile b/Dockerfile index 9c9bb474..8638c085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,4 +49,4 @@ COPY --from=builder /app/cmd/ / EXPOSE 59989 ENTRYPOINT ["/device-rfid-llrp"] -CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry"] +CMD ["-cp=keeper.http://edgex-core-keeper:59890", "--registry"] diff --git a/Makefile b/Makefile index 2f4b718f..085387ba 100644 --- a/Makefile +++ b/Makefile @@ -13,14 +13,14 @@ MICROSERVICES=cmd/device-rfid-llrp # This pulls the version of the SDK from the go.mod file. It works by looking for the line # with the SDK and printing just the version number that comes after it. -SDKVERSION=$(shell sed -En 's|.*github.com/edgexfoundry/device-sdk-go/v3 (v[\.0-9a-zA-Z-]+).*|\1|p' go.mod) +SDKVERSION=$(shell sed -En 's|.*github.com/edgexfoundry/device-sdk-go/v4 (v[\.0-9a-zA-Z-]+).*|\1|p' go.mod) # this pulls the version from local VERSION file that is created by the Jenkins Pipeline. VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0) GIT_SHA=$(shell git rev-parse HEAD) GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-rfid-llrp-go.Version=$(VERSION) \ - -X github.com/edgexfoundry/device-sdk-go/v3/internal/common.SDKVersion=$(SDKVERSION)" \ + -X github.com/edgexfoundry/device-sdk-go/v4/internal/common.SDKVersion=$(SDKVERSION)" \ -trimpath -mod=readonly ifeq ($(ENABLE_FULL_RELRO), "true") diff --git a/cmd/main.go b/cmd/main.go index 9e56fe4b..b865abfb 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -8,7 +8,7 @@ package main import ( device_llrp "github.com/edgexfoundry/device-rfid-llrp-go" "github.com/edgexfoundry/device-rfid-llrp-go/internal/driver" - "github.com/edgexfoundry/device-sdk-go/v3/pkg/startup" + "github.com/edgexfoundry/device-sdk-go/v4/pkg/startup" ) func main() { diff --git a/go.mod b/go.mod index 66bdb7ad..042cd4a9 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/edgexfoundry/device-rfid-llrp-go go 1.23 require ( - github.com/edgexfoundry/device-sdk-go/v3 v3.2.0-dev.47 - github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.53 + github.com/edgexfoundry/device-sdk-go/v4 v4.0.0-dev.1 + github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.2 github.com/stretchr/testify v1.9.0 ) @@ -17,11 +17,11 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect - github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.66 // indirect - github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.19 // indirect - github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.40 // indirect - github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.18 // indirect - github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.18 // indirect + github.com/edgexfoundry/go-mod-bootstrap/v4 v4.0.0-dev.1 // indirect + github.com/edgexfoundry/go-mod-configuration/v4 v4.0.0-dev.1 // indirect + github.com/edgexfoundry/go-mod-messaging/v4 v4.0.0-dev.2 // indirect + github.com/edgexfoundry/go-mod-registry/v4 v4.0.0-dev.1 // indirect + github.com/edgexfoundry/go-mod-secrets/v4 v4.0.0-dev.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect diff --git a/go.sum b/go.sum index 7c9bf8b6..654c8868 100644 --- a/go.sum +++ b/go.sum @@ -86,20 +86,20 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= -github.com/edgexfoundry/device-sdk-go/v3 v3.2.0-dev.47 h1:9SF70/V3ds4ozN3xaL2QSMZsSbV2glO0wDelwybv5Ro= -github.com/edgexfoundry/device-sdk-go/v3 v3.2.0-dev.47/go.mod h1:Z+bXQh9icjVrEwht1f8wj0W7mkk89qUvHDzrfvFINvs= -github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.66 h1:kmBEAhNi4ftrJMXM3IvEbwrRCOWUDuUOKTVAOgHnoPw= -github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.66/go.mod h1:3IXVpc5Qez5nwFJ8IkMyJMba8Iavj620E0XB42BQzfQ= -github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.19 h1:274NZdVBkJBuQP6yT3tVrb7psTFuIPogX/DLQqv7OCQ= -github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.19/go.mod h1:BG6hCDxXizpgMdNEljwNfLWSsd4Op7GAHd3Pis1dVv8= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.53 h1:aHnYwqpg0LcnMrgNQlkRQjzHAS/IML/9GI368OmNCz4= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.53/go.mod h1:MLk37/79M26+bZr3IptNZuYmQBEVbXwzDp1VHQkFhIk= -github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.40 h1:YyB21HEapV5pENG01vFlpjPI6UkmKpJuaWFfgGFVUsY= -github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.40/go.mod h1:8NpZ6/eAsiyZHgn/s3DRIpcOjUrve+ZONIgvcDvA3Yg= -github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.18 h1:AzILZ/xcEmSYVhIwSF4zkWpXyFoBA733E/j8ttzlNnI= -github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.18/go.mod h1:TBgZZMF8FAJwxUl3AJgHQaT0S5pwKJKKDP3d638ttrc= -github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.18 h1:UHyNs7pAdFqURAVL/BWd5riiZczVRdyb7r76dUGxqUU= -github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.18/go.mod h1:2q9qMnQD4MCAZHgXyB8ltpwuct554HOiPrbRydyXyWQ= +github.com/edgexfoundry/device-sdk-go/v4 v4.0.0-dev.1 h1:p9njuoGUwnl4X+F1xlO+jDhrkVaYPKH7UsTVKr9+1xI= +github.com/edgexfoundry/device-sdk-go/v4 v4.0.0-dev.1/go.mod h1:6ChpQagcoYqlaE8b1IiFdI2YZIsMhRIDbHC6yZtVmeM= +github.com/edgexfoundry/go-mod-bootstrap/v4 v4.0.0-dev.1 h1:9uiZON4CDOVAZNNawtncvfX4Abgz31r8QcOVEWvlUD4= +github.com/edgexfoundry/go-mod-bootstrap/v4 v4.0.0-dev.1/go.mod h1:OJdeMt2HyzMZZyKy89ICwGu4Ui7ddWd+dQXGMJTAmYk= +github.com/edgexfoundry/go-mod-configuration/v4 v4.0.0-dev.1 h1:eWcDmVFwkFSmlrD745lZQ6xs+ZKJ9u6TqNUnXuWJ5AY= +github.com/edgexfoundry/go-mod-configuration/v4 v4.0.0-dev.1/go.mod h1:AHvE7RQJabfMVHXCDDDKhg3hzJNQtUqbyB9yJxv2Qbk= +github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.2 h1:BEJKSvyW+dMTW/yzEKWjs0tGUZnMkFPYX4eypyoG0IY= +github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.2/go.mod h1:I3EG+Tg/gcVSUJ+IJDuvVKFISnRu8oQtMXqltE1rzT8= +github.com/edgexfoundry/go-mod-messaging/v4 v4.0.0-dev.2 h1:2zRS7LTEoucQmAkZ33b/Erw13ne1LoxexPhhHGa065Q= +github.com/edgexfoundry/go-mod-messaging/v4 v4.0.0-dev.2/go.mod h1:eAmCHilZWXL0skB9Frnm2kZTeY81sF6xKOmePoWKTNE= +github.com/edgexfoundry/go-mod-registry/v4 v4.0.0-dev.1 h1:/CrP00ozrLjMR0R9OTSJlQi5zJ7/9IKnfG0zS2ZN+8U= +github.com/edgexfoundry/go-mod-registry/v4 v4.0.0-dev.1/go.mod h1:YgkZ1ThNEEXPzC2iu3/53QcrDQ3tlQHlflnjb3Jseo8= +github.com/edgexfoundry/go-mod-secrets/v4 v4.0.0-dev.1 h1:lw9GNOujQhqnPMJko6n9BGU9Pu3P9RPUQYCT5GpoSw0= +github.com/edgexfoundry/go-mod-secrets/v4 v4.0.0-dev.1/go.mod h1:p6RbhVfJ/SNBLYlz8P/v6kOJmj5Zz1In5/T3TSXylO4= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= diff --git a/internal/driver/device.go b/internal/driver/device.go index 67c0a426..b9a949a0 100644 --- a/internal/driver/device.go +++ b/internal/driver/device.go @@ -13,11 +13,11 @@ import ( "sync" "time" - "github.com/edgexfoundry/device-sdk-go/v3/pkg/interfaces" - dsModels "github.com/edgexfoundry/device-sdk-go/v3/pkg/models" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" - contract "github.com/edgexfoundry/go-mod-core-contracts/v3/models" + "github.com/edgexfoundry/device-sdk-go/v4/pkg/interfaces" + dsModels "github.com/edgexfoundry/device-sdk-go/v4/pkg/models" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" + contract "github.com/edgexfoundry/go-mod-core-contracts/v4/models" "github.com/edgexfoundry/device-rfid-llrp-go/internal/retry" "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" diff --git a/internal/driver/discover.go b/internal/driver/discover.go index 135d1334..c4697f58 100644 --- a/internal/driver/discover.go +++ b/internal/driver/discover.go @@ -20,8 +20,8 @@ import ( "time" "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" - dsModels "github.com/edgexfoundry/device-sdk-go/v3/pkg/models" - contract "github.com/edgexfoundry/go-mod-core-contracts/v3/models" + dsModels "github.com/edgexfoundry/device-sdk-go/v4/pkg/models" + contract "github.com/edgexfoundry/go-mod-core-contracts/v4/models" ) const ( diff --git a/internal/driver/discover_test.go b/internal/driver/discover_test.go index 55f854eb..419d3c15 100644 --- a/internal/driver/discover_test.go +++ b/internal/driver/discover_test.go @@ -18,9 +18,9 @@ import ( "time" "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" - "github.com/edgexfoundry/device-sdk-go/v3/pkg/interfaces/mocks" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" - "github.com/edgexfoundry/go-mod-core-contracts/v3/models" + "github.com/edgexfoundry/device-sdk-go/v4/pkg/interfaces/mocks" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger" + "github.com/edgexfoundry/go-mod-core-contracts/v4/models" "github.com/stretchr/testify/mock" ) diff --git a/internal/driver/driver.go b/internal/driver/driver.go index f5c7e4c0..1a211132 100644 --- a/internal/driver/driver.go +++ b/internal/driver/driver.go @@ -19,11 +19,11 @@ import ( "sync" "time" - "github.com/edgexfoundry/device-sdk-go/v3/pkg/interfaces" - dsModels "github.com/edgexfoundry/device-sdk-go/v3/pkg/models" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" - contract "github.com/edgexfoundry/go-mod-core-contracts/v3/models" + "github.com/edgexfoundry/device-sdk-go/v4/pkg/interfaces" + dsModels "github.com/edgexfoundry/device-sdk-go/v4/pkg/models" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" + contract "github.com/edgexfoundry/go-mod-core-contracts/v4/models" "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" ) diff --git a/internal/driver/driver_test.go b/internal/driver/driver_test.go index f46d043a..f0ab3fd9 100644 --- a/internal/driver/driver_test.go +++ b/internal/driver/driver_test.go @@ -12,9 +12,9 @@ import ( "time" "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" - dsModels "github.com/edgexfoundry/device-sdk-go/v3/pkg/models" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" - "github.com/edgexfoundry/go-mod-core-contracts/v3/common" + dsModels "github.com/edgexfoundry/device-sdk-go/v4/pkg/models" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger" + "github.com/edgexfoundry/go-mod-core-contracts/v4/common" "github.com/stretchr/testify/require" ) diff --git a/internal/driver/logging.go b/internal/driver/logging.go index f955da57..0e4d7095 100644 --- a/internal/driver/logging.go +++ b/internal/driver/logging.go @@ -7,7 +7,7 @@ package driver import ( "github.com/edgexfoundry/device-rfid-llrp-go/pkg/llrp" - "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger" + "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger" ) // edgexLLRPClientLogger implements the llrp.ClientLogger interface