diff --git a/.github/workflows/callout_build.yml b/.github/workflows/device_simulator_build.yml similarity index 70% rename from .github/workflows/callout_build.yml rename to .github/workflows/device_simulator_build.yml index 935805d..9c3948f 100644 --- a/.github/workflows/callout_build.yml +++ b/.github/workflows/device_simulator_build.yml @@ -1,17 +1,17 @@ -name: callout_build +name: device-simulator_build on: workflow_dispatch: push: tags: - - 'v*.*.*-callout' + - 'v*.*.*-device-simulator' jobs: call-docker-build: uses: ./.github/workflows/docker_build.yml with: - registry: makocr.azurecr.io/callout - file: samples/callout/Dockerfile + registry: makocr.azurecr.io/device-simulator + file: samples/device-simulator/Dockerfile context: . secrets: azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} diff --git a/.github/workflows/callout_test.yml b/.github/workflows/device_simulator_test.yml similarity index 54% rename from .github/workflows/callout_test.yml rename to .github/workflows/device_simulator_test.yml index 6a566f7..abcade5 100644 --- a/.github/workflows/callout_test.yml +++ b/.github/workflows/device_simulator_test.yml @@ -1,13 +1,13 @@ -name: krill_test +name: device-simulator_test on: workflow_dispatch: push: paths: - - samples/callout/** + - samples/device-simulator/** jobs: call-mage-test: uses: ./.github/workflows/mage_tests.yml with: - workdir: samples/callout/ \ No newline at end of file + workdir: samples/device-simulator/ \ No newline at end of file diff --git a/.github/workflows/krill_build.yml b/.github/workflows/http_grpc_callout_build.yml similarity index 70% rename from .github/workflows/krill_build.yml rename to .github/workflows/http_grpc_callout_build.yml index 741c332..f68fd8a 100644 --- a/.github/workflows/krill_build.yml +++ b/.github/workflows/http_grpc_callout_build.yml @@ -1,17 +1,17 @@ -name: krill_build +name: http_grpc_callout_build on: workflow_dispatch: push: tags: - - 'v*.*.*-krill' + - 'v*.*.*-http-grpc-callout' jobs: call-docker-build: uses: ./.github/workflows/docker_build.yml with: - registry: makocr.azurecr.io/krill - file: samples/krill/Dockerfile + registry: makocr.azurecr.io/http-grpc-callout + file: samples/http-grpc-callout/Dockerfile context: . secrets: azureCredentials: ${{ secrets.AZURE_CREDENTIALS }} diff --git a/.github/workflows/krill_test.yml b/.github/workflows/http_grpc_callout_test.yml similarity index 53% rename from .github/workflows/krill_test.yml rename to .github/workflows/http_grpc_callout_test.yml index 316ba90..236b557 100644 --- a/.github/workflows/krill_test.yml +++ b/.github/workflows/http_grpc_callout_test.yml @@ -1,13 +1,13 @@ -name: krill_test +name: http_grpc_callout_test on: workflow_dispatch: push: paths: - - samples/krill/** + - samples/http-grpc-callout/** jobs: call-mage-test: uses: ./.github/workflows/mage_tests.yml with: - workdir: samples/krill/ \ No newline at end of file + workdir: samples/http-grpc-callout/ \ No newline at end of file diff --git a/samples/krill/.gitignore b/samples/device-simulator/.gitignore similarity index 94% rename from samples/krill/.gitignore rename to samples/device-simulator/.gitignore index 5e86a38..deb3f06 100644 --- a/samples/krill/.gitignore +++ b/samples/device-simulator/.gitignore @@ -4,7 +4,6 @@ bin dns.yaml /src/**/config.json /bin -/krill /listen /mqtt /manager diff --git a/samples/krill/.golangci.yml b/samples/device-simulator/.golangci.yml similarity index 100% rename from samples/krill/.golangci.yml rename to samples/device-simulator/.golangci.yml diff --git a/samples/krill/Dockerfile b/samples/device-simulator/Dockerfile similarity index 55% rename from samples/krill/Dockerfile rename to samples/device-simulator/Dockerfile index 151648d..b20ed57 100644 --- a/samples/krill/Dockerfile +++ b/samples/device-simulator/Dockerfile @@ -4,9 +4,9 @@ FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21-cbl-mariner2.0 AS build COPY ./lib /workdir/lib -COPY ./samples/krill /workdir/samples/krill +COPY ./samples/device-simulator /workdir/samples/device-simulator -WORKDIR /workdir/samples/krill +WORKDIR /workdir/samples/device-simulator RUN go mod download @@ -14,8 +14,8 @@ RUN go install github.com/magefile/mage@latest RUN mage ci -RUN go build -o ./bin/krill ./cmd/krill +RUN go build -o ./bin/device-simulator ./cmd EXPOSE 2112 -CMD [ "/bin/krill" ] +CMD [ "/bin/device-simulator" ] diff --git a/samples/krill/README.md b/samples/device-simulator/README.md similarity index 75% rename from samples/krill/README.md rename to samples/device-simulator/README.md index e7cb586..83d357a 100644 --- a/samples/krill/README.md +++ b/samples/device-simulator/README.md @@ -1,32 +1,34 @@ -# Krill +# Device Simulator ``` -⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣤⣤⣀⠀⠀⠀⠀⠀⠀ -⠀⠀⢀⣀⡙⠻⢶⣶⣦⣴⣶⣶⣶⠾⠛⠛⠋⠉⠉⠉⠉⠙⠃⠀⠀⠀⠀⠀ -⠀⠀⠀⠉⠉⠙⠛⠛⠋⠉⠉⠡⣤⣴⣶⣶⣾⣿⣿⣿⣛⣩⣤⡤⠖⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⢠⣴⣾⠂⣴⣦⠈⣿⣿⣿⣿⣿⣿⠿⠛⣋⠁⠀⠀⠀⠀⠀ -⠀⠀⢀⣼⣿⣶⣄⡉⠻⣧⣌⣁⣴⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀ -⠀⠀⣾⣿⣿⣿⣿⣿⣦⡈⢻⣿⣿⣿⣿⡿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⡀⢻⣿⣿⣿⣿⣿⣿⣿⡄⠙⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⢠⣷⣄⡉⠻⢿⣿⣿⣿⠏⠠⢶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⢸⣿⣿⣿⣶⣤⣈⠙⠁⠰⣦⣀⠉⠻⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠘⢿⣿⣿⣿⣿⣿⡇⠠⣦⣄⠉⠳⣤⠈⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⢠⣌⣉⡉⠉⣉⡁⠀⠀⠙⠗⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠹⢿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠙⠻⣿⣿⠟⢀⣤⡀⠀⠀⠀⠀⠀⠀⣀⣀⣠⣤⣤⣤⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠿⠿⡿⠂⣀⣠⣤⣤⣤⣀⣉⣉⠉⠉⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠛⠛⠛⠋⠉⠉⠁ + ____ _ _____ _ _ _ +| \ ___ _ _|_|___ ___ | __|_|_____ _ _| |___| |_ ___ ___ +| | | -_| | | | _| -_| |__ | | | | | | .'| _| . | _| +|____/|___|\_/|_|___|___| |_____|_|_|_|_|___|_|__,|_| |___|_| ``` -Krill is a highly configurable MQTT asset simulator. +Device Simulator is a highly configurable MQTT asset simulator. ## Usage -### Krill as K8s Pod +### Device Simulator as K8s Pod -`kubectl run krill --image=azbluefin.azurecr.io/krill:latest --stdin < config.yml` +```sh +# From the root of the device-simulator directory. +docker build ../.. -f Dockerfile -t .azurecr.io/device-simulator:latest -Krill runs as a pod within the desired cluster using the kubectl run command. The configuration of choice is provided via stdin of the krill process within the pod, provided in the command above using `--stdin < config.yml`. Alternative names for a configuration file may be used -- the command simply uses stdin piping to provide krill with an appropriate configuration. +# Or if running from the root of the explore-iot-operations repository. +# docker build . -f ./samples/device-simulator/Dockerfile -t .azurecr.io/device-simulator:latest + +# Push or load your newly built image into your cluster, depending on the k8s setup. +# docker push .azurecr.io/device-simulator:latest # Using AKS + Connected ACR +# minikube load .azurecr.io/device-simulator:latest # Using minikube +# docker save .azurecr.io/device-simulator:latest | k3s ctr images import - # Using K3s + +kubectl run device-simulator --image=.azurecr.io/device-simulator:latest --stdin < config.yml +``` + +Device simulator runs as a pod within the desired cluster using the kubectl run command. The configuration of choice is provided via stdin of the simulator process within the pod, provided in the command above using `--stdin < config.yml`. Alternative names for a configuration file may be used -- the command simply uses stdin piping to provide simulator with an appropriate configuration. See the example YAML configuration below, with comments describing the various configurable fields. @@ -91,6 +93,31 @@ simulation: ``` +### Device Simulator on the Command Line + +#### Method 1 + +```sh +# With Golang installed, the device simulator can be run from the cmd folder. +cd ./cmd +go run . < config.yml +# Or by reading in a file instead of stdin: +# go run . --stdin=false --config=config.yml +``` + +#### Method 2 + +```sh +# With Golang installed, build a binary of the device simulator. +go build -o ./bin/device-simulator ./cmd +./device-simulator < config.yml + +# Or by reading in a file instead of stdin: +# ./device-simulator --stdin=false --config=config.yml +``` + +## Configuring a Simulation + ### Configuring Payload Formats There are currently five supported types of payload formats: @@ -178,7 +205,7 @@ Example Equations: ## Metrics -Prometheus metrics are provided by the krill simulator at the port specified in the metrics field of the configuration. The available metrics are: +Prometheus metrics are provided by the simulator at the port specified in the metrics field of the configuration. The available metrics are: -1. `krill_entity_gauge` - shows the count of each system entity. -1. `krill__asset_publish_counter` - records the number of messages published, labeled by asset identifier. \ No newline at end of file +1. `device_simulator_entity_gauge` - shows the count of each system entity. +1. `device_simulator__asset_publish_counter` - records the number of messages published, labeled by asset identifier. \ No newline at end of file diff --git a/samples/krill/cmd/krill/main.go b/samples/device-simulator/cmd/main.go similarity index 75% rename from samples/krill/cmd/krill/main.go rename to samples/device-simulator/cmd/main.go index 357cc6c..7ee7022 100644 --- a/samples/krill/cmd/krill/main.go +++ b/samples/device-simulator/cmd/main.go @@ -14,24 +14,24 @@ import ( "github.com/explore-iot-ops/lib/env" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/broker" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/edge" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/node" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/provider" - "github.com/explore-iot-ops/samples/krill/components/publisher" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/site" - "github.com/explore-iot-ops/samples/krill/components/subscriber" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/exporter" - "github.com/explore-iot-ops/samples/krill/lib/krill" + "github.com/explore-iot-ops/samples/device-simulator/components/broker" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/edge" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/node" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/provider" + "github.com/explore-iot-ops/samples/device-simulator/components/publisher" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/site" + "github.com/explore-iot-ops/samples/device-simulator/components/subscriber" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/exporter" + "github.com/explore-iot-ops/samples/device-simulator/lib/external" "gopkg.in/yaml.v3" "github.com/prometheus/client_golang/prometheus" @@ -48,7 +48,7 @@ func main() { func run() error { - fmt.Print(krill.Krill) + fmt.Print(external.Logo) ctx := context.Background() @@ -70,8 +70,8 @@ func run() error { unmarshal = json.Unmarshal } - configReader := env.New[krill.Configuration]( - func(cr *env.ConfigurationReader[krill.Configuration]) { + configReader := env.New[external.Configuration]( + func(cr *env.ConfigurationReader[external.Configuration]) { cr.Unmarshal = unmarshal if *flags["stdin"].(*bool) { cr.ReadFile = func(_ string) ([]byte, error) { @@ -189,7 +189,7 @@ func run() error { topicService := topic.NewService(topicStore, registryStore) tracerService := tracer.NewService(tracerStore, registryStore) - builder := krill.New( + builder := external.New( brokerService, clientService, edgeService, @@ -208,7 +208,7 @@ func run() error { tracerService, ) - lg.Printf("parsing krill configuration") + lg.Printf("parsing external configuration") err = builder.Parse(configuration.Simulation) if err != nil { diff --git a/samples/krill/components/broker/broker.go b/samples/device-simulator/components/broker/broker.go similarity index 94% rename from samples/krill/components/broker/broker.go rename to samples/device-simulator/components/broker/broker.go index 94fe971..2afddf6 100644 --- a/samples/krill/components/broker/broker.go +++ b/samples/device-simulator/components/broker/broker.go @@ -7,7 +7,7 @@ package broker import ( "fmt" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) type Source interface { diff --git a/samples/krill/components/broker/broker_test.go b/samples/device-simulator/components/broker/broker_test.go similarity index 100% rename from samples/krill/components/broker/broker_test.go rename to samples/device-simulator/components/broker/broker_test.go diff --git a/samples/krill/components/broker/service.go b/samples/device-simulator/components/broker/service.go similarity index 80% rename from samples/krill/components/broker/service.go rename to samples/device-simulator/components/broker/service.go index 8051c89..b4eedc6 100644 --- a/samples/krill/components/broker/service.go +++ b/samples/device-simulator/components/broker/service.go @@ -4,9 +4,9 @@ package broker import ( - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Source, component.ID] diff --git a/samples/krill/components/broker/service_test.go b/samples/device-simulator/components/broker/service_test.go similarity index 90% rename from samples/krill/components/broker/service_test.go rename to samples/device-simulator/components/broker/service_test.go index 67b59ff..78d1e78 100644 --- a/samples/krill/components/broker/service_test.go +++ b/samples/device-simulator/components/broker/service_test.go @@ -6,9 +6,9 @@ package broker import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/client/client.go b/samples/device-simulator/components/client/client.go similarity index 97% rename from samples/krill/components/client/client.go rename to samples/device-simulator/components/client/client.go index 856eff2..b7eb66d 100644 --- a/samples/krill/components/client/client.go +++ b/samples/device-simulator/components/client/client.go @@ -12,8 +12,8 @@ import ( "time" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/site" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/site" mqtt "github.com/eclipse/paho.mqtt.golang" ) @@ -28,10 +28,7 @@ type PublisherSubscriber interface { GetName() string } -// Publisher is an interface whose implementation should include the observable functionality (see registry // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -package), +// Publisher is an interface whose implementation should include the observable functionality (see registry package), // as well as the ability to publish a message on a given topic. type Publisher interface { Publish(topic string, qos byte, messagesRetained bool, data []byte) error diff --git a/samples/krill/components/client/client_test.go b/samples/device-simulator/components/client/client_test.go similarity index 98% rename from samples/krill/components/client/client_test.go rename to samples/device-simulator/components/client/client_test.go index a41247a..a80484e 100644 --- a/samples/krill/components/client/client_test.go +++ b/samples/device-simulator/components/client/client_test.go @@ -10,8 +10,8 @@ import ( mqttv5 "github.com/eclipse/paho.golang/paho" mqtt "github.com/eclipse/paho.mqtt.golang" - "github.com/explore-iot-ops/samples/krill/components/site" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/components/site" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/client/clientv5.go b/samples/device-simulator/components/client/clientv5.go similarity index 100% rename from samples/krill/components/client/clientv5.go rename to samples/device-simulator/components/client/clientv5.go diff --git a/samples/krill/components/client/errors.go b/samples/device-simulator/components/client/errors.go similarity index 90% rename from samples/krill/components/client/errors.go rename to samples/device-simulator/components/client/errors.go index ab8e4cb..75f289b 100644 --- a/samples/krill/components/client/errors.go +++ b/samples/device-simulator/components/client/errors.go @@ -6,7 +6,7 @@ package client import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type BrokerConnectionError struct { diff --git a/samples/krill/components/client/service.go b/samples/device-simulator/components/client/service.go similarity index 87% rename from samples/krill/components/client/service.go rename to samples/device-simulator/components/client/service.go index d324459..8b7454c 100644 --- a/samples/krill/components/client/service.go +++ b/samples/device-simulator/components/client/service.go @@ -7,12 +7,12 @@ import ( "context" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/broker" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/site" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/dialer" + "github.com/explore-iot-ops/samples/device-simulator/components/broker" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/site" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/dialer" mqttv5 "github.com/eclipse/paho.golang/paho" mqttv3 "github.com/eclipse/paho.mqtt.golang" diff --git a/samples/krill/components/client/service_test.go b/samples/device-simulator/components/client/service_test.go similarity index 96% rename from samples/krill/components/client/service_test.go rename to samples/device-simulator/components/client/service_test.go index 1c7ef43..857e949 100644 --- a/samples/krill/components/client/service_test.go +++ b/samples/device-simulator/components/client/service_test.go @@ -8,11 +8,11 @@ import ( "net" "testing" - "github.com/explore-iot-ops/samples/krill/components/broker" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/site" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/dialer" + "github.com/explore-iot-ops/samples/device-simulator/components/broker" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/site" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/dialer" "github.com/stretchr/testify/require" mqttv5 "github.com/eclipse/paho.golang/paho" diff --git a/samples/krill/components/edge/edge_test.go b/samples/device-simulator/components/edge/edge_test.go similarity index 97% rename from samples/krill/components/edge/edge_test.go rename to samples/device-simulator/components/edge/edge_test.go index 54cf9f3..aed9a3b 100644 --- a/samples/krill/components/edge/edge_test.go +++ b/samples/device-simulator/components/edge/edge_test.go @@ -6,8 +6,8 @@ package edge import ( "testing" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/edge/errors.go b/samples/device-simulator/components/edge/errors.go similarity index 92% rename from samples/krill/components/edge/errors.go rename to samples/device-simulator/components/edge/errors.go index 44d9e56..8678894 100644 --- a/samples/krill/components/edge/errors.go +++ b/samples/device-simulator/components/edge/errors.go @@ -6,8 +6,8 @@ package edge import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type InvalidPositionError struct { diff --git a/samples/krill/components/edge/service.go b/samples/device-simulator/components/edge/service.go similarity index 89% rename from samples/krill/components/edge/service.go rename to samples/device-simulator/components/edge/service.go index 061d0b3..038e5f2 100644 --- a/samples/krill/components/edge/service.go +++ b/samples/device-simulator/components/edge/service.go @@ -4,9 +4,9 @@ package edge import ( - "github.com/explore-iot-ops/samples/krill/components/node" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/components/node" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" ) type Store component.Store[composition.Edge, component.ID] diff --git a/samples/krill/components/formatter/errors.go b/samples/device-simulator/components/formatter/errors.go similarity index 85% rename from samples/krill/components/formatter/errors.go rename to samples/device-simulator/components/formatter/errors.go index f1b8899..0100103 100644 --- a/samples/krill/components/formatter/errors.go +++ b/samples/device-simulator/components/formatter/errors.go @@ -6,7 +6,7 @@ package formatter import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type InvalidTypeError struct { diff --git a/samples/krill/components/formatter/formatter.go b/samples/device-simulator/components/formatter/formatter.go similarity index 96% rename from samples/krill/components/formatter/formatter.go rename to samples/device-simulator/components/formatter/formatter.go index e8e8b7a..81c443a 100644 --- a/samples/krill/components/formatter/formatter.go +++ b/samples/device-simulator/components/formatter/formatter.go @@ -12,8 +12,8 @@ import ( "io" protoEncoder "github.com/explore-iot-ops/lib/proto" - binaryEncoder "github.com/explore-iot-ops/samples/krill/lib/binary" - "github.com/explore-iot-ops/samples/krill/lib/flatten" + binaryEncoder "github.com/explore-iot-ops/samples/device-simulator/lib/binary" + "github.com/explore-iot-ops/samples/device-simulator/lib/flatten" "google.golang.org/protobuf/proto" ) diff --git a/samples/krill/components/formatter/formatter_test.go b/samples/device-simulator/components/formatter/formatter_test.go similarity index 96% rename from samples/krill/components/formatter/formatter_test.go rename to samples/device-simulator/components/formatter/formatter_test.go index ad9620d..5a3f943 100644 --- a/samples/krill/components/formatter/formatter_test.go +++ b/samples/device-simulator/components/formatter/formatter_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/explore-iot-ops/lib/proto" - "github.com/explore-iot-ops/samples/krill/lib/binary" - "github.com/explore-iot-ops/samples/krill/lib/flatten" + "github.com/explore-iot-ops/samples/device-simulator/lib/binary" + "github.com/explore-iot-ops/samples/device-simulator/lib/flatten" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/formatter/service.go b/samples/device-simulator/components/formatter/service.go similarity index 85% rename from samples/krill/components/formatter/service.go rename to samples/device-simulator/components/formatter/service.go index 010327e..11ad5f5 100644 --- a/samples/krill/components/formatter/service.go +++ b/samples/device-simulator/components/formatter/service.go @@ -7,9 +7,9 @@ import ( "encoding/binary" "github.com/explore-iot-ops/lib/proto" - encoder "github.com/explore-iot-ops/samples/krill/lib/binary" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/flatten" + encoder "github.com/explore-iot-ops/samples/device-simulator/lib/binary" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/flatten" ) type Store component.Store[Formatter, component.ID] diff --git a/samples/krill/components/formatter/service_test.go b/samples/device-simulator/components/formatter/service_test.go similarity index 97% rename from samples/krill/components/formatter/service_test.go rename to samples/device-simulator/components/formatter/service_test.go index 88b5a96..8f3918c 100644 --- a/samples/krill/components/formatter/service_test.go +++ b/samples/device-simulator/components/formatter/service_test.go @@ -6,7 +6,7 @@ package formatter import ( "testing" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/limiter/errors.go b/samples/device-simulator/components/limiter/errors.go similarity index 89% rename from samples/krill/components/limiter/errors.go rename to samples/device-simulator/components/limiter/errors.go index 78504d1..58a5fd3 100644 --- a/samples/krill/components/limiter/errors.go +++ b/samples/device-simulator/components/limiter/errors.go @@ -6,7 +6,7 @@ package limiter import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type InvalidLimitError struct { diff --git a/samples/krill/components/limiter/limiter.go b/samples/device-simulator/components/limiter/limiter.go similarity index 100% rename from samples/krill/components/limiter/limiter.go rename to samples/device-simulator/components/limiter/limiter.go diff --git a/samples/krill/components/limiter/limiter_test.go b/samples/device-simulator/components/limiter/limiter_test.go similarity index 100% rename from samples/krill/components/limiter/limiter_test.go rename to samples/device-simulator/components/limiter/limiter_test.go diff --git a/samples/krill/components/limiter/service.go b/samples/device-simulator/components/limiter/service.go similarity index 93% rename from samples/krill/components/limiter/service.go rename to samples/device-simulator/components/limiter/service.go index 8eaa48c..14a0651 100644 --- a/samples/krill/components/limiter/service.go +++ b/samples/device-simulator/components/limiter/service.go @@ -7,7 +7,7 @@ import ( "context" "time" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Limiter[struct{}], component.ID] diff --git a/samples/krill/components/limiter/service_test.go b/samples/device-simulator/components/limiter/service_test.go similarity index 95% rename from samples/krill/components/limiter/service_test.go rename to samples/device-simulator/components/limiter/service_test.go index 3832d22..ea3693d 100644 --- a/samples/krill/components/limiter/service_test.go +++ b/samples/device-simulator/components/limiter/service_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/node/errors.go b/samples/device-simulator/components/node/errors.go similarity index 90% rename from samples/krill/components/node/errors.go rename to samples/device-simulator/components/node/errors.go index 3db3b5d..d71b75a 100644 --- a/samples/krill/components/node/errors.go +++ b/samples/device-simulator/components/node/errors.go @@ -6,7 +6,7 @@ package node import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type InvalidConfigurationError struct { diff --git a/samples/krill/components/node/node_test.go b/samples/device-simulator/components/node/node_test.go similarity index 94% rename from samples/krill/components/node/node_test.go rename to samples/device-simulator/components/node/node_test.go index 90477bf..fefaf8b 100644 --- a/samples/krill/components/node/node_test.go +++ b/samples/device-simulator/components/node/node_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/node/service.go b/samples/device-simulator/components/node/service.go similarity index 86% rename from samples/krill/components/node/service.go rename to samples/device-simulator/components/node/service.go index 338e2f5..1c936a4 100644 --- a/samples/krill/components/node/service.go +++ b/samples/device-simulator/components/node/service.go @@ -7,9 +7,9 @@ import ( "go/parser" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/composition" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" ) type Store component.Store[composition.Renderer, component.ID] diff --git a/samples/krill/components/observer/observer.go b/samples/device-simulator/components/observer/observer.go similarity index 94% rename from samples/krill/components/observer/observer.go rename to samples/device-simulator/components/observer/observer.go index 52bdcf6..436fa22 100644 --- a/samples/krill/components/observer/observer.go +++ b/samples/device-simulator/components/observer/observer.go @@ -4,7 +4,7 @@ package observer import ( - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) // Observer is an implementation of the CancellableObservable interface and serves as the observer component in the simulation framework. diff --git a/samples/krill/components/observer/observer_test.go b/samples/device-simulator/components/observer/observer_test.go similarity index 95% rename from samples/krill/components/observer/observer_test.go rename to samples/device-simulator/components/observer/observer_test.go index cd7dd9f..9f7a206 100644 --- a/samples/krill/components/observer/observer_test.go +++ b/samples/device-simulator/components/observer/observer_test.go @@ -6,7 +6,7 @@ package observer import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/observer/service.go b/samples/device-simulator/components/observer/service.go similarity index 82% rename from samples/krill/components/observer/service.go rename to samples/device-simulator/components/observer/service.go index 334e8f2..23485f9 100644 --- a/samples/krill/components/observer/service.go +++ b/samples/device-simulator/components/observer/service.go @@ -4,9 +4,9 @@ package observer import ( - "github.com/explore-iot-ops/samples/krill/components/provider" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/provider" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[*Observer, component.ID] diff --git a/samples/krill/components/observer/service_test.go b/samples/device-simulator/components/observer/service_test.go similarity index 94% rename from samples/krill/components/observer/service_test.go rename to samples/device-simulator/components/observer/service_test.go index ab45319..41c79e0 100644 --- a/samples/krill/components/observer/service_test.go +++ b/samples/device-simulator/components/observer/service_test.go @@ -6,9 +6,9 @@ package observer import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/provider" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/provider" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/outlet/outlet.go b/samples/device-simulator/components/outlet/outlet.go similarity index 85% rename from samples/krill/components/outlet/outlet.go rename to samples/device-simulator/components/outlet/outlet.go index e24c435..4ca4691 100644 --- a/samples/krill/components/outlet/outlet.go +++ b/samples/device-simulator/components/outlet/outlet.go @@ -6,9 +6,9 @@ package outlet import ( "errors" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" ) var ( diff --git a/samples/krill/components/outlet/outlet_test.go b/samples/device-simulator/components/outlet/outlet_test.go similarity index 89% rename from samples/krill/components/outlet/outlet_test.go rename to samples/device-simulator/components/outlet/outlet_test.go index 70be42a..3b97162 100644 --- a/samples/krill/components/outlet/outlet_test.go +++ b/samples/device-simulator/components/outlet/outlet_test.go @@ -7,9 +7,9 @@ import ( "errors" "testing" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/outlet/service.go b/samples/device-simulator/components/outlet/service.go similarity index 79% rename from samples/krill/components/outlet/service.go rename to samples/device-simulator/components/outlet/service.go index b1b470e..0c15238 100644 --- a/samples/krill/components/outlet/service.go +++ b/samples/device-simulator/components/outlet/service.go @@ -6,10 +6,10 @@ package outlet import ( "go/parser" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" ) type Store component.Store[Outlet, component.ID] diff --git a/samples/krill/components/outlet/service_test.go b/samples/device-simulator/components/outlet/service_test.go similarity index 92% rename from samples/krill/components/outlet/service_test.go rename to samples/device-simulator/components/outlet/service_test.go index 2fd0b3d..cc3a9a6 100644 --- a/samples/krill/components/outlet/service_test.go +++ b/samples/device-simulator/components/outlet/service_test.go @@ -6,9 +6,9 @@ package outlet import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/provider/errors.go b/samples/device-simulator/components/provider/errors.go similarity index 86% rename from samples/krill/components/provider/errors.go rename to samples/device-simulator/components/provider/errors.go index f940e13..79bfc07 100644 --- a/samples/krill/components/provider/errors.go +++ b/samples/device-simulator/components/provider/errors.go @@ -6,7 +6,7 @@ package provider import ( "fmt" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" ) type InvalidTypeError struct { diff --git a/samples/krill/components/provider/provider.go b/samples/device-simulator/components/provider/provider.go similarity index 94% rename from samples/krill/components/provider/provider.go rename to samples/device-simulator/components/provider/provider.go index 1d0eb64..bba29af 100644 --- a/samples/krill/components/provider/provider.go +++ b/samples/device-simulator/components/provider/provider.go @@ -4,7 +4,7 @@ package provider import ( - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" "github.com/prometheus/client_golang/prometheus" ) diff --git a/samples/krill/components/provider/provider_test.go b/samples/device-simulator/components/provider/provider_test.go similarity index 89% rename from samples/krill/components/provider/provider_test.go rename to samples/device-simulator/components/provider/provider_test.go index e2ed2e9..23fbaa7 100644 --- a/samples/krill/components/provider/provider_test.go +++ b/samples/device-simulator/components/provider/provider_test.go @@ -6,7 +6,7 @@ package provider import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/provider/service.go b/samples/device-simulator/components/provider/service.go similarity index 86% rename from samples/krill/components/provider/service.go rename to samples/device-simulator/components/provider/service.go index accd3b0..9106a2c 100644 --- a/samples/krill/components/provider/service.go +++ b/samples/device-simulator/components/provider/service.go @@ -5,11 +5,11 @@ package provider import ( "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/counter" - "github.com/explore-iot-ops/samples/krill/lib/exporter" - "github.com/explore-iot-ops/samples/krill/lib/gauge" - "github.com/explore-iot-ops/samples/krill/lib/histogram" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/counter" + "github.com/explore-iot-ops/samples/device-simulator/lib/exporter" + "github.com/explore-iot-ops/samples/device-simulator/lib/gauge" + "github.com/explore-iot-ops/samples/device-simulator/lib/histogram" "github.com/prometheus/client_golang/prometheus" ) diff --git a/samples/krill/components/provider/service_test.go b/samples/device-simulator/components/provider/service_test.go similarity index 93% rename from samples/krill/components/provider/service_test.go rename to samples/device-simulator/components/provider/service_test.go index 849f60f..50512e1 100644 --- a/samples/krill/components/provider/service_test.go +++ b/samples/device-simulator/components/provider/service_test.go @@ -7,11 +7,11 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/counter" - "github.com/explore-iot-ops/samples/krill/lib/exporter" - "github.com/explore-iot-ops/samples/krill/lib/gauge" - "github.com/explore-iot-ops/samples/krill/lib/histogram" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/counter" + "github.com/explore-iot-ops/samples/device-simulator/lib/exporter" + "github.com/explore-iot-ops/samples/device-simulator/lib/gauge" + "github.com/explore-iot-ops/samples/device-simulator/lib/histogram" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/publisher/publisher.go b/samples/device-simulator/components/publisher/publisher.go similarity index 88% rename from samples/krill/components/publisher/publisher.go rename to samples/device-simulator/components/publisher/publisher.go index 23b9241..4484eab 100644 --- a/samples/krill/components/publisher/publisher.go +++ b/samples/device-simulator/components/publisher/publisher.go @@ -9,13 +9,13 @@ import ( "time" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/environment" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/environment" ) // Publisher is a component which routinely publishes messages on a provided topic name. diff --git a/samples/krill/components/publisher/publisher_test.go b/samples/device-simulator/components/publisher/publisher_test.go similarity index 82% rename from samples/krill/components/publisher/publisher_test.go rename to samples/device-simulator/components/publisher/publisher_test.go index 8d86c50..62d9b1d 100644 --- a/samples/krill/components/publisher/publisher_test.go +++ b/samples/device-simulator/components/publisher/publisher_test.go @@ -8,16 +8,16 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/composition" - "github.com/explore-iot-ops/samples/krill/lib/environment" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/environment" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/publisher/service.go b/samples/device-simulator/components/publisher/service.go similarity index 80% rename from samples/krill/components/publisher/service.go rename to samples/device-simulator/components/publisher/service.go index b01febd..8eef619 100644 --- a/samples/krill/components/publisher/service.go +++ b/samples/device-simulator/components/publisher/service.go @@ -7,15 +7,15 @@ import ( "context" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/environment" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/environment" ) type Store component.Store[*Publisher, component.ID] diff --git a/samples/krill/components/publisher/service_test.go b/samples/device-simulator/components/publisher/service_test.go similarity index 94% rename from samples/krill/components/publisher/service_test.go rename to samples/device-simulator/components/publisher/service_test.go index 4616db7..863d442 100644 --- a/samples/krill/components/publisher/service_test.go +++ b/samples/device-simulator/components/publisher/service_test.go @@ -8,13 +8,13 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/registry/registry.go b/samples/device-simulator/components/registry/registry.go similarity index 100% rename from samples/krill/components/registry/registry.go rename to samples/device-simulator/components/registry/registry.go diff --git a/samples/krill/components/registry/registry_test.go b/samples/device-simulator/components/registry/registry_test.go similarity index 100% rename from samples/krill/components/registry/registry_test.go rename to samples/device-simulator/components/registry/registry_test.go diff --git a/samples/krill/components/registry/service.go b/samples/device-simulator/components/registry/service.go similarity index 88% rename from samples/krill/components/registry/service.go rename to samples/device-simulator/components/registry/service.go index 16486fa..fac7618 100644 --- a/samples/krill/components/registry/service.go +++ b/samples/device-simulator/components/registry/service.go @@ -4,7 +4,7 @@ package registry import ( - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[ObservableRegistry, component.ID] diff --git a/samples/krill/components/registry/service_test.go b/samples/device-simulator/components/registry/service_test.go similarity index 90% rename from samples/krill/components/registry/service_test.go rename to samples/device-simulator/components/registry/service_test.go index e765f0d..7088fcc 100644 --- a/samples/krill/components/registry/service_test.go +++ b/samples/device-simulator/components/registry/service_test.go @@ -6,7 +6,7 @@ package registry import ( "testing" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/renderer/renderer.go b/samples/device-simulator/components/renderer/renderer.go similarity index 77% rename from samples/krill/components/renderer/renderer.go rename to samples/device-simulator/components/renderer/renderer.go index 45e6e3c..3b6dfee 100644 --- a/samples/krill/components/renderer/renderer.go +++ b/samples/device-simulator/components/renderer/renderer.go @@ -4,9 +4,9 @@ package renderer import ( - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/lib/composition" - "github.com/explore-iot-ops/samples/krill/lib/environment" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/environment" ) type Renderer interface { diff --git a/samples/krill/components/renderer/renderer_test.go b/samples/device-simulator/components/renderer/renderer_test.go similarity index 80% rename from samples/krill/components/renderer/renderer_test.go rename to samples/device-simulator/components/renderer/renderer_test.go index d469469..a68f1eb 100644 --- a/samples/krill/components/renderer/renderer_test.go +++ b/samples/device-simulator/components/renderer/renderer_test.go @@ -6,9 +6,9 @@ package renderer import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/lib/composition" - "github.com/explore-iot-ops/samples/krill/lib/environment" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/lib/environment" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/renderer/service.go b/samples/device-simulator/components/renderer/service.go similarity index 80% rename from samples/krill/components/renderer/service.go rename to samples/device-simulator/components/renderer/service.go index 5fa7025..201cef4 100644 --- a/samples/krill/components/renderer/service.go +++ b/samples/device-simulator/components/renderer/service.go @@ -4,9 +4,9 @@ package renderer import ( - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/node" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/node" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Renderer, component.ID] diff --git a/samples/krill/components/renderer/service_test.go b/samples/device-simulator/components/renderer/service_test.go similarity index 91% rename from samples/krill/components/renderer/service_test.go rename to samples/device-simulator/components/renderer/service_test.go index 2189d41..d03434c 100644 --- a/samples/krill/components/renderer/service_test.go +++ b/samples/device-simulator/components/renderer/service_test.go @@ -6,9 +6,9 @@ package renderer import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/composition" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/composition" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/site/service.go b/samples/device-simulator/components/site/service.go similarity index 79% rename from samples/krill/components/site/service.go rename to samples/device-simulator/components/site/service.go index 696db74..6878968 100644 --- a/samples/krill/components/site/service.go +++ b/samples/device-simulator/components/site/service.go @@ -4,9 +4,9 @@ package site import ( - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Site, component.ID] diff --git a/samples/krill/components/site/service_test.go b/samples/device-simulator/components/site/service_test.go similarity index 93% rename from samples/krill/components/site/service_test.go rename to samples/device-simulator/components/site/service_test.go index d4a7b2d..18a283e 100644 --- a/samples/krill/components/site/service_test.go +++ b/samples/device-simulator/components/site/service_test.go @@ -6,8 +6,8 @@ package site import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/site/site.go b/samples/device-simulator/components/site/site.go similarity index 92% rename from samples/krill/components/site/site.go rename to samples/device-simulator/components/site/site.go index fee1798..b9e14ff 100644 --- a/samples/krill/components/site/site.go +++ b/samples/device-simulator/components/site/site.go @@ -4,7 +4,7 @@ // package site provides the implementation of the site component of the simulation framework. package site -import "github.com/explore-iot-ops/samples/krill/components/registry" +import "github.com/explore-iot-ops/samples/device-simulator/components/registry" type Site interface { Render() string diff --git a/samples/krill/components/site/site_test.go b/samples/device-simulator/components/site/site_test.go similarity index 100% rename from samples/krill/components/site/site_test.go rename to samples/device-simulator/components/site/site_test.go diff --git a/samples/krill/components/subscriber/service.go b/samples/device-simulator/components/subscriber/service.go similarity index 81% rename from samples/krill/components/subscriber/service.go rename to samples/device-simulator/components/subscriber/service.go index dd5baaf..988a144 100644 --- a/samples/krill/components/subscriber/service.go +++ b/samples/device-simulator/components/subscriber/service.go @@ -5,13 +5,13 @@ package subscriber import ( "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[*Subscriber, component.ID] diff --git a/samples/krill/components/subscriber/service_test.go b/samples/device-simulator/components/subscriber/service_test.go similarity index 95% rename from samples/krill/components/subscriber/service_test.go rename to samples/device-simulator/components/subscriber/service_test.go index f529eaa..4553749 100644 --- a/samples/krill/components/subscriber/service_test.go +++ b/samples/device-simulator/components/subscriber/service_test.go @@ -7,12 +7,12 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/subscriber/subscriber.go b/samples/device-simulator/components/subscriber/subscriber.go similarity index 88% rename from samples/krill/components/subscriber/subscriber.go rename to samples/device-simulator/components/subscriber/subscriber.go index ec634ea..88bcc00 100644 --- a/samples/krill/components/subscriber/subscriber.go +++ b/samples/device-simulator/components/subscriber/subscriber.go @@ -8,11 +8,11 @@ import ( "fmt" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" ) type ClientConnectionClosedError struct { diff --git a/samples/krill/components/subscriber/subscriber_test.go b/samples/device-simulator/components/subscriber/subscriber_test.go similarity index 91% rename from samples/krill/components/subscriber/subscriber_test.go rename to samples/device-simulator/components/subscriber/subscriber_test.go index d2d4831..6fcf668 100644 --- a/samples/krill/components/subscriber/subscriber_test.go +++ b/samples/device-simulator/components/subscriber/subscriber_test.go @@ -6,11 +6,11 @@ package subscriber import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/topic/service.go b/samples/device-simulator/components/topic/service.go similarity index 80% rename from samples/krill/components/topic/service.go rename to samples/device-simulator/components/topic/service.go index cfc23cd..b5c2faf 100644 --- a/samples/krill/components/topic/service.go +++ b/samples/device-simulator/components/topic/service.go @@ -4,9 +4,9 @@ package topic import ( - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Renderer, component.ID] diff --git a/samples/krill/components/topic/service_test.go b/samples/device-simulator/components/topic/service_test.go similarity index 93% rename from samples/krill/components/topic/service_test.go rename to samples/device-simulator/components/topic/service_test.go index ca4204c..7768416 100644 --- a/samples/krill/components/topic/service_test.go +++ b/samples/device-simulator/components/topic/service_test.go @@ -6,8 +6,8 @@ package topic import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/topic/topic.go b/samples/device-simulator/components/topic/topic.go similarity index 93% rename from samples/krill/components/topic/topic.go rename to samples/device-simulator/components/topic/topic.go index d080e92..10b6dd3 100644 --- a/samples/krill/components/topic/topic.go +++ b/samples/device-simulator/components/topic/topic.go @@ -5,7 +5,7 @@ package topic import ( - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) // Renderer is an interface whose implementation should be able to render a topic name when called and should also implement the registry observable interface. diff --git a/samples/krill/components/topic/topic_test.go b/samples/device-simulator/components/topic/topic_test.go similarity index 100% rename from samples/krill/components/topic/topic_test.go rename to samples/device-simulator/components/topic/topic_test.go diff --git a/samples/krill/components/tracer/service.go b/samples/device-simulator/components/tracer/service.go similarity index 83% rename from samples/krill/components/tracer/service.go rename to samples/device-simulator/components/tracer/service.go index ef373d2..a98393d 100644 --- a/samples/krill/components/tracer/service.go +++ b/samples/device-simulator/components/tracer/service.go @@ -5,9 +5,9 @@ package tracer import ( "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" ) type Store component.Store[Tracer, component.ID] diff --git a/samples/krill/components/tracer/service_test.go b/samples/device-simulator/components/tracer/service_test.go similarity index 93% rename from samples/krill/components/tracer/service_test.go rename to samples/device-simulator/components/tracer/service_test.go index 8929411..10c1db8 100644 --- a/samples/krill/components/tracer/service_test.go +++ b/samples/device-simulator/components/tracer/service_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/components/tracer/tracer.go b/samples/device-simulator/components/tracer/tracer.go similarity index 94% rename from samples/krill/components/tracer/tracer.go rename to samples/device-simulator/components/tracer/tracer.go index b8fd71c..cb4674e 100644 --- a/samples/krill/components/tracer/tracer.go +++ b/samples/device-simulator/components/tracer/tracer.go @@ -8,7 +8,7 @@ import ( "time" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) type Tracer interface { diff --git a/samples/krill/components/tracer/tracer_test.go b/samples/device-simulator/components/tracer/tracer_test.go similarity index 92% rename from samples/krill/components/tracer/tracer_test.go rename to samples/device-simulator/components/tracer/tracer_test.go index 459dc9b..4b6c017 100644 --- a/samples/krill/components/tracer/tracer_test.go +++ b/samples/device-simulator/components/tracer/tracer_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/configs/simple/config.yml b/samples/device-simulator/configs/simple/config.yml similarity index 100% rename from samples/krill/configs/simple/config.yml rename to samples/device-simulator/configs/simple/config.yml diff --git a/samples/krill/go.mod b/samples/device-simulator/go.mod similarity index 97% rename from samples/krill/go.mod rename to samples/device-simulator/go.mod index 386e217..a69ba59 100644 --- a/samples/krill/go.mod +++ b/samples/device-simulator/go.mod @@ -1,4 +1,4 @@ -module github.com/explore-iot-ops/samples/krill +module github.com/explore-iot-ops/samples/device-simulator go 1.21.3 diff --git a/samples/krill/go.sum b/samples/device-simulator/go.sum similarity index 100% rename from samples/krill/go.sum rename to samples/device-simulator/go.sum diff --git a/samples/krill/lib/binary/binary.go b/samples/device-simulator/lib/binary/binary.go similarity index 100% rename from samples/krill/lib/binary/binary.go rename to samples/device-simulator/lib/binary/binary.go diff --git a/samples/krill/lib/binary/binary_test.go b/samples/device-simulator/lib/binary/binary_test.go similarity index 100% rename from samples/krill/lib/binary/binary_test.go rename to samples/device-simulator/lib/binary/binary_test.go diff --git a/samples/krill/lib/component/component.go b/samples/device-simulator/lib/component/component.go similarity index 100% rename from samples/krill/lib/component/component.go rename to samples/device-simulator/lib/component/component.go diff --git a/samples/krill/lib/component/component_test.go b/samples/device-simulator/lib/component/component_test.go similarity index 100% rename from samples/krill/lib/component/component_test.go rename to samples/device-simulator/lib/component/component_test.go diff --git a/samples/krill/lib/component/errors.go b/samples/device-simulator/lib/component/errors.go similarity index 100% rename from samples/krill/lib/component/errors.go rename to samples/device-simulator/lib/component/errors.go diff --git a/samples/krill/lib/component/mock.go b/samples/device-simulator/lib/component/mock.go similarity index 100% rename from samples/krill/lib/component/mock.go rename to samples/device-simulator/lib/component/mock.go diff --git a/samples/krill/lib/component/store.go b/samples/device-simulator/lib/component/store.go similarity index 100% rename from samples/krill/lib/component/store.go rename to samples/device-simulator/lib/component/store.go diff --git a/samples/krill/lib/component/store_test.go b/samples/device-simulator/lib/component/store_test.go similarity index 100% rename from samples/krill/lib/component/store_test.go rename to samples/device-simulator/lib/component/store_test.go diff --git a/samples/krill/lib/composition/composition.go b/samples/device-simulator/lib/composition/composition.go similarity index 97% rename from samples/krill/lib/composition/composition.go rename to samples/device-simulator/lib/composition/composition.go index 1cc6bbb..a6331f0 100644 --- a/samples/krill/lib/composition/composition.go +++ b/samples/device-simulator/lib/composition/composition.go @@ -7,7 +7,7 @@ import ( "sort" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" ) const ( diff --git a/samples/krill/lib/composition/composition_test.go b/samples/device-simulator/lib/composition/composition_test.go similarity index 97% rename from samples/krill/lib/composition/composition_test.go rename to samples/device-simulator/lib/composition/composition_test.go index 0514c5c..f4862e1 100644 --- a/samples/krill/lib/composition/composition_test.go +++ b/samples/device-simulator/lib/composition/composition_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/lib/expression" + "github.com/explore-iot-ops/samples/device-simulator/lib/expression" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/lib/composition/mock.go b/samples/device-simulator/lib/composition/mock.go similarity index 100% rename from samples/krill/lib/composition/mock.go rename to samples/device-simulator/lib/composition/mock.go diff --git a/samples/krill/lib/counter/counter.go b/samples/device-simulator/lib/counter/counter.go similarity index 96% rename from samples/krill/lib/counter/counter.go rename to samples/device-simulator/lib/counter/counter.go index 838b057..412a96c 100644 --- a/samples/krill/lib/counter/counter.go +++ b/samples/device-simulator/lib/counter/counter.go @@ -8,8 +8,8 @@ package counter import ( "fmt" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/prometheus/client_golang/prometheus" ) diff --git a/samples/krill/lib/counter/counter_test.go b/samples/device-simulator/lib/counter/counter_test.go similarity index 100% rename from samples/krill/lib/counter/counter_test.go rename to samples/device-simulator/lib/counter/counter_test.go diff --git a/samples/krill/lib/dialer/dialer.go b/samples/device-simulator/lib/dialer/dialer.go similarity index 100% rename from samples/krill/lib/dialer/dialer.go rename to samples/device-simulator/lib/dialer/dialer.go diff --git a/samples/krill/lib/dialer/dialer_test.go b/samples/device-simulator/lib/dialer/dialer_test.go similarity index 100% rename from samples/krill/lib/dialer/dialer_test.go rename to samples/device-simulator/lib/dialer/dialer_test.go diff --git a/samples/krill/lib/environment/environment.go b/samples/device-simulator/lib/environment/environment.go similarity index 100% rename from samples/krill/lib/environment/environment.go rename to samples/device-simulator/lib/environment/environment.go diff --git a/samples/krill/lib/environment/environment_test.go b/samples/device-simulator/lib/environment/environment_test.go similarity index 100% rename from samples/krill/lib/environment/environment_test.go rename to samples/device-simulator/lib/environment/environment_test.go diff --git a/samples/krill/lib/errors/errors.go b/samples/device-simulator/lib/errors/errors.go similarity index 100% rename from samples/krill/lib/errors/errors.go rename to samples/device-simulator/lib/errors/errors.go diff --git a/samples/krill/lib/errors/errors_test.go b/samples/device-simulator/lib/errors/errors_test.go similarity index 100% rename from samples/krill/lib/errors/errors_test.go rename to samples/device-simulator/lib/errors/errors_test.go diff --git a/samples/krill/lib/errors/fiber.go b/samples/device-simulator/lib/errors/fiber.go similarity index 100% rename from samples/krill/lib/errors/fiber.go rename to samples/device-simulator/lib/errors/fiber.go diff --git a/samples/krill/lib/exporter/exporter.go b/samples/device-simulator/lib/exporter/exporter.go similarity index 97% rename from samples/krill/lib/exporter/exporter.go rename to samples/device-simulator/lib/exporter/exporter.go index 41ca88f..4bdc1f4 100644 --- a/samples/krill/lib/exporter/exporter.go +++ b/samples/device-simulator/lib/exporter/exporter.go @@ -14,7 +14,7 @@ import ( "sync" "time" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) type Exporter interface { diff --git a/samples/krill/lib/exporter/exporter_test.go b/samples/device-simulator/lib/exporter/exporter_test.go similarity index 98% rename from samples/krill/lib/exporter/exporter_test.go rename to samples/device-simulator/lib/exporter/exporter_test.go index 9058554..6efd666 100644 --- a/samples/krill/lib/exporter/exporter_test.go +++ b/samples/device-simulator/lib/exporter/exporter_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/lib/exporter/mock.go b/samples/device-simulator/lib/exporter/mock.go similarity index 93% rename from samples/krill/lib/exporter/mock.go rename to samples/device-simulator/lib/exporter/mock.go index 943d4a6..c34f79c 100644 --- a/samples/krill/lib/exporter/mock.go +++ b/samples/device-simulator/lib/exporter/mock.go @@ -6,7 +6,7 @@ package exporter import ( "io" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) type MockExporter struct { diff --git a/samples/krill/lib/exporter/provider.go b/samples/device-simulator/lib/exporter/provider.go similarity index 93% rename from samples/krill/lib/exporter/provider.go rename to samples/device-simulator/lib/exporter/provider.go index ae45fe5..78bf87f 100644 --- a/samples/krill/lib/exporter/provider.go +++ b/samples/device-simulator/lib/exporter/provider.go @@ -5,7 +5,7 @@ package exporter import ( "github.com/explore-iot-ops/lib/logger" - "github.com/explore-iot-ops/samples/krill/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" ) type CustomHistogramProvider struct { diff --git a/samples/krill/lib/exporter/stat.go b/samples/device-simulator/lib/exporter/stat.go similarity index 100% rename from samples/krill/lib/exporter/stat.go rename to samples/device-simulator/lib/exporter/stat.go diff --git a/samples/krill/lib/expression/expression.go b/samples/device-simulator/lib/expression/expression.go similarity index 100% rename from samples/krill/lib/expression/expression.go rename to samples/device-simulator/lib/expression/expression.go diff --git a/samples/krill/lib/expression/expression_test.go b/samples/device-simulator/lib/expression/expression_test.go similarity index 100% rename from samples/krill/lib/expression/expression_test.go rename to samples/device-simulator/lib/expression/expression_test.go diff --git a/samples/krill/lib/krill/configuration.go b/samples/device-simulator/lib/external/configuration.go similarity index 74% rename from samples/krill/lib/krill/configuration.go rename to samples/device-simulator/lib/external/configuration.go index 25b7b45..4abf01b 100644 --- a/samples/krill/lib/krill/configuration.go +++ b/samples/device-simulator/lib/external/configuration.go @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -package krill +package external type ( // Tag describes the structure of a simulated tag, including its ID, @@ -69,7 +69,7 @@ type ( RefData int `json:"refData" yaml:"refData"` } - // Configuration describes the overall configuration structure for the krill simulator. + // Configuration describes the overall configuration structure for the simulator. Configuration struct { Simulation Simulation `json:"simulation" yaml:"simulation"` Ports Ports `json:"ports" yaml:"ports"` @@ -90,7 +90,7 @@ const ( TagIDFormat = "%s__%s__%d" TagParentIDFormat = "%s__parent" TagChildIDFormat = "%s__child" - ProviderIDFormat = "krill_%s_asset_publish_counter" + ProviderIDFormat = "device_simulator_%s_asset_publish_counter" TagTimestampIDFormat = "%s__timestamp" OPCUATimeExpression = "now()" @@ -116,26 +116,10 @@ const ( ) const ( - Krill = ` -⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣤⣤⣀⠀⠀⠀⠀⠀⠀ -⠀⠀⢀⣀⡙⠻⢶⣶⣦⣴⣶⣶⣶⠾⠛⠛⠋⠉⠉⠉⠉⠙⠃⠀⠀⠀⠀⠀ -⠀⠀⠀⠉⠉⠙⠛⠛⠋⠉⠉⠡⣤⣴⣶⣶⣾⣿⣿⣿⣛⣩⣤⡤⠖⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⢠⣴⣾⠂⣴⣦⠈⣿⣿⣿⣿⣿⣿⠿⠛⣋⠁⠀⠀⠀⠀⠀ -⠀⠀⢀⣼⣿⣶⣄⡉⠻⣧⣌⣁⣴⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀ -⠀⠀⣾⣿⣿⣿⣿⣿⣦⡈⢻⣿⣿⣿⣿⡿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⡀⢻⣿⣿⣿⣿⣿⣿⣿⡄⠙⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⢠⣷⣄⡉⠻⢿⣿⣿⣿⠏⠠⢶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⢸⣿⣿⣿⣶⣤⣈⠙⠁⠰⣦⣀⠉⠻⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠘⢿⣿⣿⣿⣿⣿⡇⠠⣦⣄⠉⠳⣤⠈⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⢠⣌⣉⡉⠉⣉⡁⠀⠀⠙⠗⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠹⢿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠙⠻⣿⣿⠟⢀⣤⡀⠀⠀⠀⠀⠀⠀⣀⣀⣠⣤⣤⣤⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠿⠿⡿⠂⣀⣠⣤⣤⣤⣀⣉⣉⠉⠉⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠛⠛⠛⠋⠉⠉⠁⠀⠀⠀⠀ - _ _ _ _ - | |__ _ _ <_>| || | - | / /| '_>| || || | - |_\_\|_| |_||_||_| - + Logo = ` + ____ _ _____ _ _ _ +| \ ___ _ _|_|___ ___ | __|_|_____ _ _| |___| |_ ___ ___ +| | | -_| | | | _| -_| |__ | | | | | | .'| _| . | _| +|____/|___|\_/|_|___|___| |_____|_|_|_|_|___|_|__,|_| |___|_| ` ) diff --git a/samples/krill/lib/krill/krill.go b/samples/device-simulator/lib/external/external.go similarity index 83% rename from samples/krill/lib/krill/krill.go rename to samples/device-simulator/lib/external/external.go index 485872f..259ae4a 100644 --- a/samples/krill/lib/krill/krill.go +++ b/samples/device-simulator/lib/external/external.go @@ -1,34 +1,34 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -package krill +package external import ( "errors" "fmt" "io" - "github.com/explore-iot-ops/samples/krill/components/broker" - "github.com/explore-iot-ops/samples/krill/components/client" - "github.com/explore-iot-ops/samples/krill/components/edge" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/limiter" - "github.com/explore-iot-ops/samples/krill/components/node" - "github.com/explore-iot-ops/samples/krill/components/observer" - "github.com/explore-iot-ops/samples/krill/components/outlet" - "github.com/explore-iot-ops/samples/krill/components/provider" - "github.com/explore-iot-ops/samples/krill/components/publisher" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/components/site" - "github.com/explore-iot-ops/samples/krill/components/subscriber" - "github.com/explore-iot-ops/samples/krill/components/topic" - "github.com/explore-iot-ops/samples/krill/components/tracer" - "github.com/explore-iot-ops/samples/krill/lib/component" - "github.com/explore-iot-ops/samples/krill/lib/templater" + "github.com/explore-iot-ops/samples/device-simulator/components/broker" + "github.com/explore-iot-ops/samples/device-simulator/components/client" + "github.com/explore-iot-ops/samples/device-simulator/components/edge" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/limiter" + "github.com/explore-iot-ops/samples/device-simulator/components/node" + "github.com/explore-iot-ops/samples/device-simulator/components/observer" + "github.com/explore-iot-ops/samples/device-simulator/components/outlet" + "github.com/explore-iot-ops/samples/device-simulator/components/provider" + "github.com/explore-iot-ops/samples/device-simulator/components/publisher" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/components/site" + "github.com/explore-iot-ops/samples/device-simulator/components/subscriber" + "github.com/explore-iot-ops/samples/device-simulator/components/topic" + "github.com/explore-iot-ops/samples/device-simulator/components/tracer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/lib/templater" ) -type KrillBuilder struct { +type DeviceSimulatorBuilder struct { brokerService component.Service[*broker.Component, component.ID] clientService component.Service[*client.Component, component.ID] edgeService component.Service[*edge.Component, component.ID] @@ -64,8 +64,8 @@ func New( subscriberService component.Service[*subscriber.Component, component.ID], topicService component.Service[*topic.Component, component.ID], tracerService component.Service[*tracer.Component, component.ID], -) *KrillBuilder { - return &KrillBuilder{ +) *DeviceSimulatorBuilder { + return &DeviceSimulatorBuilder{ brokerService: brokerService, clientService: clientService, edgeService: edgeService, @@ -85,7 +85,7 @@ func New( } } -func (builder *KrillBuilder) Parse(configuration Simulation) error { +func (builder *DeviceSimulatorBuilder) Parse(configuration Simulation) error { err := builder.brokerService.Create(BrokerID, &broker.Component{ Broker: configuration.Target.Host, Port: configuration.Target.Port, @@ -104,7 +104,7 @@ func (builder *KrillBuilder) Parse(configuration Simulation) error { return nil } -func (builder *KrillBuilder) ParseSite(configuration Site) error { +func (builder *DeviceSimulatorBuilder) ParseSite(configuration Site) error { err := builder.siteService.Create( component.ID(configuration.Name), &site.Component{ @@ -144,7 +144,7 @@ func (builder *KrillBuilder) ParseSite(configuration Site) error { return nil } -func (builder *KrillBuilder) ParseTopics( +func (builder *DeviceSimulatorBuilder) ParseTopics( configuration Site, tags []string, assets []string, @@ -195,7 +195,7 @@ func (builder *KrillBuilder) ParseTopics( return nil } -func (builder *KrillBuilder) ParseTopicAndPublisher( +func (builder *DeviceSimulatorBuilder) ParseTopicAndPublisher( configuration Site, id string, name string, @@ -230,7 +230,7 @@ func (builder *KrillBuilder) ParseTopicAndPublisher( ) } -func (builder *KrillBuilder) ParseTags(configuration Site) ([]string, error) { +func (builder *DeviceSimulatorBuilder) ParseTags(configuration Site) ([]string, error) { switch configuration.PayloadFormat { case "JSONTagPerMessage": return builder.ParseJSONTagPerMessage(configuration) @@ -251,7 +251,7 @@ func (builder *KrillBuilder) ParseTags(configuration Site) ([]string, error) { } } -func (builder *KrillBuilder) ParseAssets(configuration Site) ([]string, error) { +func (builder *DeviceSimulatorBuilder) ParseAssets(configuration Site) ([]string, error) { assets := make([]string, configuration.AssetCount) for count := 0; count < configuration.AssetCount; count++ { asset, err := builder.ParseAsset(configuration, count) @@ -264,7 +264,7 @@ func (builder *KrillBuilder) ParseAssets(configuration Site) ([]string, error) { return assets, nil } -func (builder *KrillBuilder) ParseAsset( +func (builder *DeviceSimulatorBuilder) ParseAsset( configuration Site, count int, ) (string, error) { @@ -307,7 +307,7 @@ func (builder *KrillBuilder) ParseAsset( return clientID, nil } -func (builder *KrillBuilder) ParseJSONTagPerMessage( +func (builder *DeviceSimulatorBuilder) ParseJSONTagPerMessage( configuration Site, ) ([]string, error) { err := builder.formatterService.Create( @@ -334,7 +334,7 @@ func (builder *KrillBuilder) ParseJSONTagPerMessage( return tagNames, nil } -func (builder *KrillBuilder) ParseJSONTag( +func (builder *DeviceSimulatorBuilder) ParseJSONTag( siteName string, tag Tag, count int, @@ -362,7 +362,7 @@ func (builder *KrillBuilder) ParseJSONTag( return tagID, nil } -func (builder *KrillBuilder) ParseOPCUA(configuration Site) ([]string, error) { +func (builder *DeviceSimulatorBuilder) ParseOPCUA(configuration Site) ([]string, error) { err := builder.ParseFormatter( configuration.Name, formatter.JSON, @@ -438,7 +438,7 @@ func (builder *KrillBuilder) ParseOPCUA(configuration Site) ([]string, error) { return []string{configuration.Name}, nil } -func (builder *KrillBuilder) ParseOPCUATag( +func (builder *DeviceSimulatorBuilder) ParseOPCUATag( configuration Site, rootId string, tag Tag, @@ -477,7 +477,7 @@ func (builder *KrillBuilder) ParseOPCUATag( ) } -func (builder *KrillBuilder) ParseExpressionNode( +func (builder *DeviceSimulatorBuilder) ParseExpressionNode( rootNodeId, nodeId, edgeId, nodeExpression string, edgeConfiguration any, edgeType edge.Type, @@ -498,7 +498,7 @@ func (builder *KrillBuilder) ParseExpressionNode( }) } -func (builder *KrillBuilder) ParseCollectionNode( +func (builder *DeviceSimulatorBuilder) ParseCollectionNode( rootNodeId, nodeId, edgeId, edgeConfiguration string, ) error { err := builder.nodeService.Create(component.ID(nodeId), &node.Component{ @@ -516,7 +516,7 @@ func (builder *KrillBuilder) ParseCollectionNode( }) } -func (builder *KrillBuilder) ParseComplex( +func (builder *DeviceSimulatorBuilder) ParseComplex( configuration Site, format formatter.Type, ) ([]string, error) { @@ -546,7 +546,7 @@ func (builder *KrillBuilder) ParseComplex( return []string{configuration.Name}, nil } -func (builder *KrillBuilder) ParseFormatter( +func (builder *DeviceSimulatorBuilder) ParseFormatter( id string, format formatter.Type, nodeType node.Type, @@ -564,7 +564,7 @@ func (builder *KrillBuilder) ParseFormatter( return builder.ParseRootNode(id, id, nodeType) } -func (builder *KrillBuilder) ParseRootNode( +func (builder *DeviceSimulatorBuilder) ParseRootNode( formatterID string, id string, nodeType node.Type, @@ -582,7 +582,7 @@ func (builder *KrillBuilder) ParseRootNode( }) } -func (builder *KrillBuilder) ParseFlat( +func (builder *DeviceSimulatorBuilder) ParseFlat( configuration Site, format formatter.Type, ) ([]string, error) { diff --git a/samples/krill/lib/krill/krill_test.go b/samples/device-simulator/lib/external/external_test.go similarity index 90% rename from samples/krill/lib/krill/krill_test.go rename to samples/device-simulator/lib/external/external_test.go index ee8fb8c..21b2b24 100644 --- a/samples/krill/lib/krill/krill_test.go +++ b/samples/device-simulator/lib/external/external_test.go @@ -1,52 +1,52 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -package krill +package external import ( "testing" - "github.com/explore-iot-ops/samples/krill/components/edge" - "github.com/explore-iot-ops/samples/krill/components/formatter" - "github.com/explore-iot-ops/samples/krill/components/node" - "github.com/explore-iot-ops/samples/krill/components/renderer" - "github.com/explore-iot-ops/samples/krill/lib/component" + "github.com/explore-iot-ops/samples/device-simulator/components/edge" + "github.com/explore-iot-ops/samples/device-simulator/components/formatter" + "github.com/explore-iot-ops/samples/device-simulator/components/node" + "github.com/explore-iot-ops/samples/device-simulator/components/renderer" + "github.com/explore-iot-ops/samples/device-simulator/lib/component" "github.com/stretchr/testify/require" ) var ( - MockKrillTag = Tag{ + MockDeviceSimulatorTag = Tag{ ID: "float_1", Configuration: "1", Count: 1, MissingChance: 0, } - MockKrillRate = Rate{ + MockDeviceSimulatorRate = Rate{ MessagesPerPeriod: 10, PeriodSeconds: 1, TagsPerMessage: 1, } - MockKrillTarget = Target{ + MockDeviceSimulatorTarget = Target{ Host: "localhost", Port: 1883, } - MockKrillSite = Site{ + MockDeviceSimulatorSite = Site{ Name: "site0", Tags: []Tag{ - MockKrillTag, + MockDeviceSimulatorTag, }, AssetCount: 1, - Rate: MockKrillRate, + Rate: MockDeviceSimulatorRate, PayloadFormat: "JSON", TopicFormat: "{{.SiteName}}/{{.AssetName}}", QoSLevel: 1, MQTTVersion: "v5", } - MockKrillConfiguration = Simulation{ + MockDeviceSimulatorConfiguration = Simulation{ Sites: []Site{ - MockKrillSite, + MockDeviceSimulatorSite, }, - Target: MockKrillTarget, + Target: MockDeviceSimulatorTarget, } ) @@ -69,7 +69,7 @@ func TestMain(m *testing.M) { } func TestParseExpressionNode(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { require.Equal(t, MockChildNodeID, string(identifier)) @@ -101,7 +101,7 @@ func TestParseExpressionNode(t *testing.T) { } func TestParseExpressionNodeNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return &component.MockError{} @@ -114,7 +114,7 @@ func TestParseExpressionNodeNodeError(t *testing.T) { } func TestParseCollectionNode(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { require.Equal(t, MockChildNodeID, string(identifier)) @@ -144,7 +144,7 @@ func TestParseCollectionNode(t *testing.T) { } func TestParseCollectionNodeNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return &component.MockError{} @@ -157,7 +157,7 @@ func TestParseCollectionNodeNodeError(t *testing.T) { } func TestParseRootNode(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { require.Equal(t, MockRootNodeID, string(identifier)) @@ -184,7 +184,7 @@ func TestParseRootNode(t *testing.T) { } func TestParseRootNodeNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return &component.MockError{} @@ -197,7 +197,7 @@ func TestParseRootNodeNodeError(t *testing.T) { } func TestParseFormatter(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { require.Equal(t, MockFormatterID, string(identifier)) @@ -221,7 +221,7 @@ func TestParseFormatter(t *testing.T) { } func TestParseFormatterError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { return &component.MockError{} @@ -243,7 +243,7 @@ func TestParseFormatterError(t *testing.T) { } func TestParseFlat(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { require.Equal(t, MockFormatterType, entity.Type) @@ -281,7 +281,7 @@ func TestParseFlat(t *testing.T) { } func TestParseFlatFormatterError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { return &component.MockError{} @@ -294,7 +294,7 @@ func TestParseFlatFormatterError(t *testing.T) { } func TestParseFlatExpressionNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { return nil @@ -327,7 +327,7 @@ func TestParseFlatExpressionNodeError(t *testing.T) { } func TestParseJSONTag(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return nil @@ -357,7 +357,7 @@ func TestParseJSONTag(t *testing.T) { } func TestParseJSONTagRootNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return &component.MockError{} @@ -374,7 +374,7 @@ func TestParseJSONTagRootNodeError(t *testing.T) { } func TestParseJSONTagExpressionNodeError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ nodeService: &component.MockService[*node.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *node.Component) error { return nil @@ -395,7 +395,7 @@ func TestParseJSONTagExpressionNodeError(t *testing.T) { } func TestParseJSONTagPerMessage(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { require.Equal(t, MockSiteName, string(identifier)) @@ -432,7 +432,7 @@ func TestParseJSONTagPerMessage(t *testing.T) { } func TestParseJSONTagPerMessageFormatterError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { return &component.MockError{} @@ -445,7 +445,7 @@ func TestParseJSONTagPerMessageFormatterError(t *testing.T) { } func TestParseJSONTagPerMessageParseJSONTagError(t *testing.T) { - builder := &KrillBuilder{ + builder := &DeviceSimulatorBuilder{ formatterService: &component.MockService[*formatter.Component, component.ID]{ OnCreate: func(identifier component.ID, entity *formatter.Component) error { return nil diff --git a/samples/krill/lib/flatten/flatten.go b/samples/device-simulator/lib/flatten/flatten.go similarity index 100% rename from samples/krill/lib/flatten/flatten.go rename to samples/device-simulator/lib/flatten/flatten.go diff --git a/samples/krill/lib/flatten/flatten_test.go b/samples/device-simulator/lib/flatten/flatten_test.go similarity index 100% rename from samples/krill/lib/flatten/flatten_test.go rename to samples/device-simulator/lib/flatten/flatten_test.go diff --git a/samples/krill/lib/gauge/gauge.go b/samples/device-simulator/lib/gauge/gauge.go similarity index 94% rename from samples/krill/lib/gauge/gauge.go rename to samples/device-simulator/lib/gauge/gauge.go index d082884..dd435ea 100644 --- a/samples/krill/lib/gauge/gauge.go +++ b/samples/device-simulator/lib/gauge/gauge.go @@ -6,8 +6,8 @@ package gauge import ( "fmt" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/prometheus/client_golang/prometheus" ) diff --git a/samples/krill/lib/gauge/gauge_test.go b/samples/device-simulator/lib/gauge/gauge_test.go similarity index 100% rename from samples/krill/lib/gauge/gauge_test.go rename to samples/device-simulator/lib/gauge/gauge_test.go diff --git a/samples/krill/lib/histogram/histogram.go b/samples/device-simulator/lib/histogram/histogram.go similarity index 97% rename from samples/krill/lib/histogram/histogram.go rename to samples/device-simulator/lib/histogram/histogram.go index 8178ef7..9cbb01c 100644 --- a/samples/krill/lib/histogram/histogram.go +++ b/samples/device-simulator/lib/histogram/histogram.go @@ -8,8 +8,8 @@ package histogram import ( "fmt" - "github.com/explore-iot-ops/samples/krill/components/registry" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/components/registry" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/prometheus/client_golang/prometheus" ) diff --git a/samples/krill/lib/histogram/histogram_test.go b/samples/device-simulator/lib/histogram/histogram_test.go similarity index 100% rename from samples/krill/lib/histogram/histogram_test.go rename to samples/device-simulator/lib/histogram/histogram_test.go diff --git a/samples/krill/lib/templater/templater.go b/samples/device-simulator/lib/templater/templater.go similarity index 100% rename from samples/krill/lib/templater/templater.go rename to samples/device-simulator/lib/templater/templater.go diff --git a/samples/krill/lib/templater/templater_test.go b/samples/device-simulator/lib/templater/templater_test.go similarity index 96% rename from samples/krill/lib/templater/templater_test.go rename to samples/device-simulator/lib/templater/templater_test.go index 3c4a737..8cd6547 100755 --- a/samples/krill/lib/templater/templater_test.go +++ b/samples/device-simulator/lib/templater/templater_test.go @@ -8,7 +8,7 @@ import ( "testing" "text/template" - "github.com/explore-iot-ops/samples/krill/lib/errors" + "github.com/explore-iot-ops/samples/device-simulator/lib/errors" "github.com/stretchr/testify/require" ) diff --git a/samples/krill/magefile.go b/samples/device-simulator/magefile.go similarity index 73% rename from samples/krill/magefile.go rename to samples/device-simulator/magefile.go index 9fd2bda..cd248db 100644 --- a/samples/krill/magefile.go +++ b/samples/device-simulator/magefile.go @@ -12,8 +12,8 @@ import ( func CI() error { return mage.CI( - "github.com/explore-iot-ops/samples/krill/", - map[string]any{"cmd/krill": nil}, + "github.com/explore-iot-ops/samples/device-simulator/", + map[string]any{"cmd": nil}, 3000, 0.00, 82.50, diff --git a/samples/callout/Dockerfile b/samples/http-grpc-callout/Dockerfile similarity index 100% rename from samples/callout/Dockerfile rename to samples/http-grpc-callout/Dockerfile diff --git a/samples/callout/cmd/config.go b/samples/http-grpc-callout/cmd/config.go similarity index 100% rename from samples/callout/cmd/config.go rename to samples/http-grpc-callout/cmd/config.go diff --git a/samples/callout/cmd/config.yml b/samples/http-grpc-callout/cmd/config.yml similarity index 100% rename from samples/callout/cmd/config.yml rename to samples/http-grpc-callout/cmd/config.yml diff --git a/samples/callout/cmd/grpc.go b/samples/http-grpc-callout/cmd/grpc.go similarity index 100% rename from samples/callout/cmd/grpc.go rename to samples/http-grpc-callout/cmd/grpc.go diff --git a/samples/callout/cmd/main.go b/samples/http-grpc-callout/cmd/main.go similarity index 100% rename from samples/callout/cmd/main.go rename to samples/http-grpc-callout/cmd/main.go diff --git a/samples/callout/cmd/output.go b/samples/http-grpc-callout/cmd/output.go similarity index 100% rename from samples/callout/cmd/output.go rename to samples/http-grpc-callout/cmd/output.go diff --git a/samples/callout/cmd/server.go b/samples/http-grpc-callout/cmd/server.go similarity index 100% rename from samples/callout/cmd/server.go rename to samples/http-grpc-callout/cmd/server.go diff --git a/samples/callout/cover.tmp.out b/samples/http-grpc-callout/cover.tmp.out similarity index 100% rename from samples/callout/cover.tmp.out rename to samples/http-grpc-callout/cover.tmp.out diff --git a/samples/callout/coverage.out b/samples/http-grpc-callout/coverage.out similarity index 100% rename from samples/callout/coverage.out rename to samples/http-grpc-callout/coverage.out diff --git a/samples/callout/go.mod b/samples/http-grpc-callout/go.mod similarity index 100% rename from samples/callout/go.mod rename to samples/http-grpc-callout/go.mod diff --git a/samples/callout/go.sum b/samples/http-grpc-callout/go.sum similarity index 100% rename from samples/callout/go.sum rename to samples/http-grpc-callout/go.sum diff --git a/samples/callout/magefile.go b/samples/http-grpc-callout/magefile.go similarity index 100% rename from samples/callout/magefile.go rename to samples/http-grpc-callout/magefile.go