* Update increment ID to UUID in things service
Update increment ID to UUID for things and channels in things
service and proto files. Also, update ID type from uint to string.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in http adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in ws adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in CoAP adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in normalizer service
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in writer services
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in reader services
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in SDK
Update increment ID to UUID in SDK. Update id type to string.
Update tests.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in mqtt adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Remove unnecessary case from influxdb reader
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update tests in order to increase code coverage
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update lora adapter to use string ID instead of unsigned int
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Add TLS support to CoAP adapter and all readers
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Add new env vars to README files
Add tls env vars to README files for CoAP adapter, WS adapter
and all readers.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update all services to exit on invalid TLS env var value
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Fix empty protobuf values
Update Normalizer service and .proto files. Reader and Writer services
needs to be updated due to message format change.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update HTTP adapter to use gogo protobuf
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Reader services API
Update API or Reader services to match Message changes due to switching to gogo/proto.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update InfluxDB services
Update InfluxDB Reader and Writer services to match new Message format.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update MongoDB services
Update MongoDB Reader and Writer services to match new message format.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Cassandra services
Update Cassandra Reader and Writer service to match new Message format.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Fix InfluxDB Reader test
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Makefile and docs accordingly
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Fix possible data race in InfluxDB writer
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update InfluxDB Writer tests
Raise test coverage.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Fix InfluxDB reader
Fix wrong ValueSum readings. Upadete tests and raise coverage.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update MongoDB services tests
Raise test coverage for MongoDB Reader and Writer services.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Readers API tests
Raise test coverage.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Raise test coverage
Update Cassandra Reader and Writer services tests.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Use gogo/protobuf in CoAP adapter
Add gogo/protobuf to Gopkg.toml and update dependencies.
Update Dockerfile to run `make proto`.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Cassandra Reader tests
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Refactor code
Improve code style and comments to improve readability.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Rename Sum to SumValue
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Rename Values to Value
Since message contains only single value (or possibly no value at all),
`Values` name could be misleading. Rename simple double value from
`Value` to `FloatValue` accordingly.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Fix InfluxDB Reader logging
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Replace exclusive if statements with switch-case
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update Cassandra services tests
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Bring old CoAP code back
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix channel ID formatting due to type change
Uncomment error handling for authorization.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update CoAP adapter docs
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Add copyright headers
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Remove redundant type declaration
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add CoAP adapter to the list of services
Add CoAp adapter in Makefile services list and fix corresponding documentation.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Refactor CoAP code
Merge multipe `const` block int single and declare consts before vars.
Un-export notFound handler since there is no need to export it.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update http version endpoint
This separates CoAP and HTTP APIs.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Refactor CoAP POST method handling
This PR is a part of CoAP adapter refactoring that will simplify adapter implementation.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Refactor CoAP adapter
Change CoAP message handling to simplify adapter implementation.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add backoff timeout for server ping to client
Update CoAP adapter to provide subset of necessary features from
protocol specification.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Fix leaking locked goroutine
In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Format code
Use more meaningful name for Handlers map.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Use and stop ticker from the same goroutine
Stop handler Ticker from ping goroutine rather than the cancel goroutine.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Check if subscription already exists in put method
Fix potential leak of handlers providing check inside of put method.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Use MessageID as Observe option
Since MessageID satisfies observe option behaviour, use Message ID
instead of local timestamp. Remove Thicker from handler and use it on
transport layer.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Use name Observer insted of Handler
Name `Observer` is used in protocol specification, so this naming makes
code more self-documenting.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add CoAP adapter to docker-compose.yml
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add copyright headers
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Remove unused constants
Fix service name in startup log message.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add metrics endpoint
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Refactor code
Config fields from main.go should not be exported; minor style changes.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Update authorization URI-Query option
Use `authorization` value in URI-Query option instead of `key`. This
mimics Authorization header in some other protocols (e.g. HTTP). Please
note that this value can be replaced with simple `auth` to save space,
due to constrained URI-Query option size.
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Add pagination to clients and channels endpoints
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Refactor code
Change method signature and rename Bulk methods back to All.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Rename transport_test.go to endpoint_test.go
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix manager tests to support pagination
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Add default offset and limit support
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update docs
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update tests to support pagination
- Move maxLimitSize checking to request validation.
- Add tests to support pagination.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix handling query params for pagination
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix empty result set
Return empty results if invalid offset and limit is passed to channel and client repository.
Update tests accordingly.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update manager API docs
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix response to invalid limit query param
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Remove offset and limmit checks in repository methods
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>