Skip to content

Commit

Permalink
Merge pull request #705 from weichou1229/v4-module
Browse files Browse the repository at this point in the history
refactor!: update module to v4
  • Loading branch information
cloudxxx8 authored Oct 30, 2024
2 parents a2016d4 + b35bedd commit 4b0ee57
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 57 deletions.
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,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"
- dependency-name: "github.com/edgexfoundry/go-mod-bootstrap/v4"
# Included when device-sdk-go is updated
14 changes: 7 additions & 7 deletions Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ https://github.com/cenkalti/backoff/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-core-contracts (Apache 2.0) https://github.com/edgexfoundry/go-mod-core-contracts/v3
edgexfoundry/go-mod-core-contracts (Apache 2.0) https://github.com/edgexfoundry/go-mod-core-contracts/v4
https://github.com/edgexfoundry/go-mod-core-contracts/blob/master/LICENSE

edgexfoundry/go-mod-registry (Apache 2.0) https://github.com/edgexfoundry/go-mod-registry/v3
edgexfoundry/go-mod-registry (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 (Apache 2.0) https://github.com/edgexfoundry/device-sdk-go/v3
edgexfoundry/device-sdk-go (Apache 2.0) https://github.com/edgexfoundry/device-sdk-go/v4
https://github.com/edgexfoundry/device-sdk-go/blob/master/LICENSE

gorilla/websocket (BSD-2) https://github.com/gorilla/websocket
Expand Down Expand Up @@ -87,13 +87,13 @@ https://github.com/hashicorp/errwrap/blob/master/LICENSE
hashicorp/go-multierror (Mozilla Public License 2.0) https://github.com/hashicorp/go-multierror
https://github.com/hashicorp/go-multierror/blob/master/LICENSE

edgexfoundry/go-mod-bootstrap (Apache 2.0) https://github.com/edgexfoundry/go-mod-bootstrap/v3
edgexfoundry/go-mod-bootstrap (Apache 2.0) https://github.com/edgexfoundry/go-mod-bootstrap/v4
https://github.com/edgexfoundry/go-mod-bootstrap/blob/master/LICENSE

edgexfoundry/go-mod-secrets (Apache 2.0) https://github.com/edgexfoundry/go-mod-secrets/v3
edgexfoundry/go-mod-secrets (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 (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration/v3
edgexfoundry/go-mod-configuration (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration/v4
https://github.com/edgexfoundry/go-mod-configuration/blob/master/LICENSE

fxamacker/cbor (MIT) https://github.com/fxamacker/cbor/v2
Expand Down Expand Up @@ -126,7 +126,7 @@ https://github.com/go-playground/validator/blob/master/LICENSE
leodido/go-urn (MIT) https://github.com/leodido/go-urn
https://github.com/leodido/go-urn

edgexfoundry/go-mod-messaging (Apache 2.0) https://github.com/edgexfoundry/go-mod-messaging/v3
edgexfoundry/go-mod-messaging (Apache 2.0) https://github.com/edgexfoundry/go-mod-messaging/v4
https://github.com/edgexfoundry/go-mod-messaging/blob/master/LICENSE

golang.org/x/net (Unspecified) https://github.com/golang/net
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ COPY --from=builder /device-mqtt-go/Attribution.txt /
EXPOSE 59982

ENTRYPOINT ["/device-mqtt"]
CMD ["--cp=consul://edgex-core-consul:8500", "--registry"]
CMD ["-cp=keeper.http://edgex-core-keeper:59890", "--registry"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ DOCKERS=docker_device_mqtt_go
VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0)
GIT_SHA=$(shell git rev-parse HEAD)

SDKVERSION=$(shell cat ./go.mod | grep 'github.com/edgexfoundry/device-sdk-go/v3 v' | awk '{print $$2}')
SDKVERSION=$(shell cat ./go.mod | grep 'github.com/edgexfoundry/device-sdk-go/v4 v' | awk '{print $$2}')
GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-mqtt-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")
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package main

import (
"github.com/edgexfoundry/device-sdk-go/v3/pkg/startup"
"github.com/edgexfoundry/device-sdk-go/v4/pkg/startup"

"github.com/edgexfoundry/device-mqtt-go"
"github.com/edgexfoundry/device-mqtt-go/internal/driver"
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.23

require (
github.com/eclipse/paho.mqtt.golang v1.5.0
github.com/edgexfoundry/device-sdk-go/v3 v3.2.0-dev.47
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.66
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-bootstrap/v4 v4.0.0-dev.1
github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.2
github.com/google/uuid v1.6.0
github.com/spf13/cast v1.7.0
github.com/stretchr/testify v1.9.0
Expand All @@ -20,10 +20,10 @@ require (
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // 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-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
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 6 additions & 6 deletions internal/driver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"fmt"
"net/url"

"github.com/edgexfoundry/go-mod-bootstrap/v3/bootstrap/interfaces"
"github.com/edgexfoundry/go-mod-bootstrap/v3/bootstrap/secret"
"github.com/edgexfoundry/go-mod-bootstrap/v3/bootstrap/startup"
"github.com/edgexfoundry/go-mod-bootstrap/v3/config"
"github.com/edgexfoundry/go-mod-core-contracts/v3/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v3/models"
"github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/interfaces"
"github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/secret"
"github.com/edgexfoundry/go-mod-bootstrap/v4/bootstrap/startup"
"github.com/edgexfoundry/go-mod-bootstrap/v4/config"
"github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
)

type ServiceConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/driver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package driver
import (
"testing"

"github.com/edgexfoundry/go-mod-core-contracts/v3/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v3/models"
"github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v4/models"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
12 changes: 6 additions & 6 deletions internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"time"

mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/edgexfoundry/device-sdk-go/v3/pkg/interfaces"
sdkModel "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"
"github.com/edgexfoundry/go-mod-core-contracts/v3/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v3/models"
"github.com/edgexfoundry/device-sdk-go/v4/pkg/interfaces"
sdkModel "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/edgexfoundry/go-mod-core-contracts/v4/errors"
"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
"github.com/google/uuid"
"github.com/spf13/cast"
)
Expand Down
6 changes: 3 additions & 3 deletions internal/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"strings"
"testing"

"github.com/edgexfoundry/go-mod-core-contracts/v3/clients/logger"
"github.com/edgexfoundry/go-mod-core-contracts/v3/common"
"github.com/edgexfoundry/go-mod-core-contracts/v3/models"
"github.com/edgexfoundry/go-mod-core-contracts/v4/clients/logger"
"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
"github.com/edgexfoundry/go-mod-core-contracts/v4/models"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions internal/driver/incominglistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"

mqtt "github.com/eclipse/paho.mqtt.golang"
sdkModels "github.com/edgexfoundry/device-sdk-go/v3/pkg/models"
"github.com/edgexfoundry/go-mod-core-contracts/v3/models"
sdkModels "github.com/edgexfoundry/device-sdk-go/v4/pkg/models"
"github.com/edgexfoundry/go-mod-core-contracts/v4/models"
)

func (d *Driver) onIncomingDataReceived(_ mqtt.Client, message mqtt.Message) {
Expand Down
2 changes: 1 addition & 1 deletion internal/driver/readingchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package driver
import (
"math"

"github.com/edgexfoundry/go-mod-core-contracts/v3/common"
"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
"github.com/spf13/cast"
)

Expand Down

0 comments on commit 4b0ee57

Please sign in to comment.