Skip to content

Commit

Permalink
refactor!: Change configuration and device toml files to yaml
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Configuration and device files now use yaml

closes: #552
Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
  • Loading branch information
marcpfuller committed Apr 5, 2023
1 parent c80097c commit 3944987
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 125 deletions.
3 changes: 0 additions & 3 deletions Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ https://github.com/go-yaml/yaml/blob/v3/LICENSE
google/uuid (BSD-3) https://github.com/google/uuid
https://github.com/google/uuid/blob/master/LICENSE

pelletier/go-toml (MIT) https://github.com/pelletier/go-toml
https://github.com/pelletier/go-toml/blob/master/LICENSE

spf13/cast (MIT) https://github.com/spf13/cast
https://github.com/spf13/cast/blob/master/LICENSE

Expand Down
51 changes: 0 additions & 51 deletions cmd/res/configuration.toml

This file was deleted.

59 changes: 59 additions & 0 deletions cmd/res/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
MaxEventSize: 0 # value 0 unlimit the maximum event size that can be sent to message bus or core-data

Writable:
LogLevel: "INFO"
# InsecureSecrets are required for when Redis is used for message bus
InsecureSecrets:
MQTT:
SecretName: "credentials"
SecretData:
username: ""
password: ""

Service:
Host: "localhost"
Port: 59982
StartupMsg: "device mqtt started"
# uncomment when running from command-line in hybrid mode with -cp -o flags
# Clients:
# core-metadata:
# Host: "localhost"
# Registry:
# Host: "localhost"

MessageBus:
# Host: localhost # uncomment when running from command-line in hybrid mode
Optional:
# Default MQTT & NATS Specific options that need to be here to enable environment variable overrides of them
ClientId: "device-mqtt"

MQTTBrokerInfo:
Schema: "tcp"
Host: "localhost"
Port: 1883
Qos: 0
KeepAlive: 3600
ClientId: "device-mqtt"

CredentialsRetryTime: 120 # Seconds
CredentialsRetryWait: 1 # Seconds
ConnEstablishingRetry: 10
ConnRetryWaitTime: 5

# AuthMode is the MQTT broker authentication mechanism. Currently, "none" and "usernamepassword" is the only AuthMode supported by this service, and the secret keys are "username" and "password".
AuthMode: "none"
CredentialsName: "credentials"

# Comment out/remove when using multi-level topics
IncomingTopic: "DataTopic"
ResponseTopic: "ResponseTopic"
UseTopicLevels: false

# Uncomment to use multi-level topics
# IncomingTopic: "incoming/data/#"
# ResponseTopic: "command/response/#"
# UseTopicLevels: true

Writable:
# ResponseFetchInterval specifies the retry interval(milliseconds) to fetch the command response from the MQTT broker
ResponseFetchInterval: 500
16 changes: 0 additions & 16 deletions cmd/res/devices/mqtt.test.device.toml

This file was deleted.

16 changes: 16 additions & 0 deletions cmd/res/devices/mqtt.test.device.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Pre-define Devices
deviceList:
- name: "MQTT-test-device"
profileName: "Test-Device-MQTT-Profile"
description: "MQTT device is created for test purpose"
labels: [ "MQTT", "test" ]
protocols:
mqtt:
# Comment out/remove below to use multi-level topics
CommandTopic: "CommandTopic"
# Uncomment below to use multi-level topics
# CommandTopic: "command/MQTT-test-device"
# autoEvents:
# interval: "20s"
# onChange: false
# sourceName: "testrandfloat32"
33 changes: 16 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.20

require (
github.com/eclipse/paho.mqtt.golang v1.4.2
github.com/edgexfoundry/device-sdk-go/v3 v3.0.0-dev.55
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.47
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.30
github.com/edgexfoundry/device-sdk-go/v3 v3.0.0-dev.63
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.61
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.35
github.com/google/uuid v1.3.0
github.com/spf13/cast v1.5.0
github.com/stretchr/testify v1.8.2
Expand All @@ -18,22 +18,22 @@ require (
github.com/armon/go-metrics v0.3.10 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.7 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.18 // indirect
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.5 // indirect
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.9 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.10 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.19 // indirect
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.7 // indirect
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.10 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/go-playground/validator/v10 v10.12.0 // indirect
github.com/go-redis/redis/v7 v7.3.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/consul/api v1.19.1 // indirect
github.com/hashicorp/consul/api v1.20.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-hclog v0.14.1 // indirect
Expand All @@ -42,7 +42,7 @@ require (
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/leodido/go-urn v1.2.1 // indirect
github.com/leodido/go-urn v1.2.2 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/consulstructure v0.0.0-20190329231841-56fdc4d2da54 // indirect
Expand All @@ -53,19 +53,18 @@ require (
github.com/nats-io/nats.go v1.24.0 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/spiffe/go-spiffe/v2 v2.1.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/zeebo/errs v1.3.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.5.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230109162033-3c3c17ce83e6 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
Loading

0 comments on commit 3944987

Please sign in to comment.