Skip to content

Commit

Permalink
refactor!: update module to v4
Browse files Browse the repository at this point in the history
BREAKING CHANGE: import paths will need to change to v4, also replace consul with keeper

Signed-off-by: Ginny Guan <[email protected]>
  • Loading branch information
jinlinGuan committed Oct 30, 2024
1 parent 4e127a5 commit 29cfcd2
Show file tree
Hide file tree
Showing 102 changed files with 701 additions and 1,052 deletions.
427 changes: 173 additions & 254 deletions app-service-template/Attribution.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app-service-template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ COPY --from=builder /app/app-new-service /app-new-service
EXPOSE 59740

ENTRYPOINT ["/app-new-service"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry"]
CMD ["-cp=keeper.http://edgex-core-keeper:59890", "--registry"]
2 changes: 1 addition & 1 deletion app-service-template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ APPVERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0)
SDKVERSION=$(shell cat ./go.mod | grep 'github.com/edgexfoundry/app-functions-sdk-go/v3 v' | sed 's/require//g' | awk '{print $$2}')

MICROSERVICE=app-new-service
GOFLAGS=-ldflags "-s -w -X github.com/edgexfoundry/app-functions-sdk-go/v3/internal.SDKVersion=$(SDKVERSION) -X github.com/edgexfoundry/app-functions-sdk-go/v3/internal.ApplicationVersion=$(APPVERSION)" -trimpath -mod=readonly
GOFLAGS=-ldflags "-s -w -X github.com/edgexfoundry/app-functions-sdk-go/v4/internal.SDKVersion=$(SDKVERSION) -X github.com/edgexfoundry/app-functions-sdk-go/v4/internal.ApplicationVersion=$(APPVERSION)" -trimpath -mod=readonly

# TODO: uncomment and remove default once files are in a Github repository or
# remove totally including usage below
Expand Down
4 changes: 2 additions & 2 deletions app-service-template/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package config

// This file contains example of custom configuration that can be loaded from the service's configuration.yaml
// and/or the Configuration Provider, aka Consul (if enabled).
// and/or the Configuration Provider, aka keeper (if enabled).
// For more details see https://docs.edgexfoundry.org/latest/microservices/application/GeneralAppServiceConfig/#custom-configuration
// TODO: Update this configuration as needed for you service's needs and remove this comment
// or remove this file if not using custom configuration.
Expand All @@ -38,7 +38,7 @@ type ServiceConfig struct {
}

// AppCustomConfig is example of service's custom structured configuration that is specified in the service's
// configuration.yaml file and Configuration Provider (aka Consul), if enabled.
// configuration.yaml file and Configuration Provider (aka keeper), if enabled.
type AppCustomConfig struct {
ResourceNames string
SomeValue int
Expand Down
6 changes: 3 additions & 3 deletions app-service-template/functions/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (

gometrics "github.com/rcrowley/go-metrics"

"github.com/edgexfoundry/app-functions-sdk-go/v3/pkg/interfaces"
"github.com/edgexfoundry/app-functions-sdk-go/v4/pkg/interfaces"

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

// TODO: Remove sample metric and implement meaningful metrics if any needed.
Expand Down
18 changes: 9 additions & 9 deletions app-service-template/functions/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import (
"os"
"testing"

"github.com/edgexfoundry/app-functions-sdk-go/v3/pkg"
"github.com/edgexfoundry/app-functions-sdk-go/v3/pkg/interfaces"
"github.com/edgexfoundry/app-functions-sdk-go/v3/pkg/interfaces/mocks"
mocks2 "github.com/edgexfoundry/go-mod-core-contracts/v3/clients/interfaces/mocks"
"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/dtos"
"github.com/edgexfoundry/go-mod-core-contracts/v3/dtos/responses"
edgexErrors "github.com/edgexfoundry/go-mod-core-contracts/v3/errors"
"github.com/edgexfoundry/app-functions-sdk-go/v4/pkg"
"github.com/edgexfoundry/app-functions-sdk-go/v4/pkg/interfaces"
"github.com/edgexfoundry/app-functions-sdk-go/v4/pkg/interfaces/mocks"
mocks2 "github.com/edgexfoundry/go-mod-core-contracts/v4/clients/interfaces/mocks"
"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/dtos"
"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
edgexErrors "github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
"github.com/stretchr/testify/mock"

"github.com/google/uuid"
Expand Down
28 changes: 8 additions & 20 deletions app-service-template/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ go 1.23

// To build local docker image of the template App you must
// comment out this replace statement and update the SDK version to latest
replace github.com/edgexfoundry/app-functions-sdk-go/v3 => ../
replace github.com/edgexfoundry/app-functions-sdk-go/v4 => ../

require (
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.1.1
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.53
github.com/edgexfoundry/app-functions-sdk-go/v4 v4.0.0
github.com/edgexfoundry/go-mod-core-contracts/v4 v4.0.0-dev.2
github.com/google/uuid v1.6.0
github.com/labstack/echo/v4 v4.12.0
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
Expand All @@ -19,20 +19,17 @@ require (

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df // indirect
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/diegoholiveira/jsonlogic/v3 v3.5.3 // 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/fatih/color v1.16.0 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v4 v4.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-configuration/v4 v4.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-messaging/v4 v4.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-registry/v4 v4.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-secrets/v4 v4.0.0-dev.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
Expand Down Expand Up @@ -66,15 +63,8 @@ require (
github.com/gorilla/schema v1.4.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/consul/api v1.29.4 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
Expand All @@ -92,9 +82,7 @@ require (
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/michaelquigley/pfxlog v0.6.10 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/consulstructure v0.0.0-20190329231841-56fdc4d2da54 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
Expand Down
Loading

0 comments on commit 29cfcd2

Please sign in to comment.