This repo contains implementation of following components:
- sink
- sensor
- decrypt (for testing purpose)
- GO 1.23
- Docker(optional) for proto rebuild
- OpenSSL
git clone https://github.com/DmytroMaslov/telemetry-task.gitmake gen-certmake buildmake run-sinkor
./tmp/bin/sink --config ./artifacts/sink/config.yamlhere:
config - path to configuration file in yaml format
example of configuration:
bind_address: "localhost:8080"
file_path: "./tmp/metrics.txt"
buffer_size: 1024
flush_interval: 100
rate_limit: 1048576
cert: ./certs/server-cert.pem
key: ./certs/server-key.pemhere:
file_path- file where metric data will be collectedbuffer_size- size of sink internal (in memory) buffer; in bytesflush_interval- how often data from buffer is flushed to disk; in millisecondsrate_limit- max input flow rate in bytes/seccert- path to certkey- path to key NOTE: ifcertorkeyare empty or do not exist sink will run without TLS
make run-sensoror
./tmp/bin/sensor --addr localhost:8080 --name sensorName --rate 100 --cert=./certs/ca-cert.pemhere:
addr- address of sink servername- name of the sensorrate- metrics per secondcert- path to cert file NOTE: ifcertis empty or does not exist, sensor will be run in insecure mode
make decryptor
./tmp/bin/decrypt --input=./tmp/metrics.txt --output=./tmp/metrics_decrypted.txthere:
input- path to file with encrypted dataoutput- path to file where decrypted data will be saved