* NOISSUE - Fix default nats publisher subject
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use created timestamp inn transformer
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use created timestamp in transformer
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* rename topic -> subject for nats
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* revert
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* revert
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix subscriber topic
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix timestamp
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use int64 nanoseconds Created timestamp
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Typo
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Add comment to created protobuf field
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Rm gogo from scripts/ci.sh
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix comment
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Return publisher in NewPublisher
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Refactor messaging
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Rename SubscribeHandler to MessageHandler
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove `Auth` event logs
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update message pubsub APi
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix topics handling
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update CoAP adapter
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update Twins service
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update LoRa adapter
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update OPC UA adapter
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove broker package
Package `broker` is conceptually renamed to package `nats`.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update makefile
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Add comment explanation
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix MQTT adapter
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix typo
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Move NATS pub/sub implementation to pubsub pkg
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove an empty line in main methods
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Move messaging-related code to messaging package
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix Twins mocks
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Change Occurred back to Created
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix tranformer test
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix message proto commands
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Replace string literal with constant
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove alias from main method
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Change messaging pubsub alias
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Rename occured to created
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Handle NATS connection in the NATS PubSub
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Rename n to pub/pubSub
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix typos
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* MF-1078 - Add reception time to published messages and use it if SenML time is missing
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix comments
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Add message timestamp
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix pub
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Mv timestamp to service layer
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Revert WS
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix coap
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix CI bot
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Rename Timestamp Created
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Mv Created field to message creation
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Mv Created field to message creation
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use UnixNano
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use google.protobuf.Timestamp
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Add protoc-gen-gogo and gogoproto to CI script
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use TimestampProto to generate timestamp
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* NOISSUEE - Create broker package for NATS
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Create funcs to return NATS connection
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* mv os.exit to main
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix Reviews
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix tests and typos
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix CI
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix reviews
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Unify Publisher and Subscriber interfaces
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Rename Nats interface
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* typo
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Mv message.pb.go, messsage.proto and topics.go to broker directory
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix go.mod
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Use mainflux broker for writers and twins services
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix go.mod
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix twins tests
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix make proto
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix message.proto
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix golangcibot
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* regenerate message.pb.go
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix comment
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix comment
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Fix make proto
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Add NATS errors
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
* Add Transformer tests
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix readers and writers
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix README typo
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Tidy vendor
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove link field from docs
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Change CanAccess to CanAccessByKey for things
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Change CanAccess in remaining occurances
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Regenerate generated files
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Generate pb.go files with protoc 3.6.1
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Add content type to MQTT sub topic
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove default content type value
Remove default content type value (SenML JSON) and replace it with
an empty string.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update docs in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add format to raw message and content type mapping
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add format as part of content type header
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add format to content-type header for WS adapter
Add format as part of content-type and add support for
content-type header and query parameter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add support for format and content-type in MQTT adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add format and content-type to CoAP adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add documentation for content type and format
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add comments to MQTT code
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix SenML JSON CoAP code type
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove format from the adapters
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove format from the docs
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove format field from MQTT adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update content type to be optional
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add support for CBOR content type in the normalizer
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update docs for MQTT content type
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing dependencies
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to users service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the things service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the http adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the ws adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the CoAP adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update LoRa adapter in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update SDK tests in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update bootstrap service in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update reader services with accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update .env and docker-compose file
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add jaeger and timeout env vars
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix broken test for can access by id endpoint
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update deps with proto empty package
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix CoAP mux
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove prints and commented code
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Add authorization section to the docs
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Slow down Bootstrap gif
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Use heading 4 instead of italic
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Replace gif with carousel
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Commit for mainflux-596
Modified and tested:
- cli
- http
- mqtt
- normalizer
- all readers
- sdk messages
- all writers
- ws
Missing:
- coap
- lora
Signed-off-by: ale <ale@metaverso.org>
* - fix subtopic name in, when starting with dot, http/ws/mqtt
- add some test on readers
Signed-off-by: ale <ale@metaverso.org>
* - fix string concatenation
- update http/transport regexp to match subtopic names with only \w-
- update ws/transport regexp like http ones with also the wildcard * and >
Signed-off-by: ale <ale@metaverso.org>
* added subtopic support to coap adapter
Signed-off-by: ale <ale@metaverso.org>
* - update replace functions with replaceall when needed
- renamed getDestChannel to fmtSubject
- update api/transport and ws/transport route to be more readable
- fix mqtt syntax
- renamed func andQuery to query as suggested by @anovakovic01
- have a nice we :)
Signed-off-by: ale <ale@metaverso.org>
* - fix error declaration on ws/nat/publisher
- fix regexp added missing allowed chars - and _ on coap/api/transport
- fix subtopic clean suffix / if present on coap/api/transport
- improve regexp on http and ws /api/transport, now does not accept url that do not strictly match
- add some ws subtopic tests
Signed-off-by: ale <ale@metaverso.org>
* - enabled wildcard chars on coap/api/transport
- allow use special chars on http and ws api/transport
Signed-off-by: ale <ale@metaverso.org>
* - use strings.Replace() insted ReplaceAll()
Signed-off-by: ale <ale@metaverso.org>
* - allow every chars on subtopics
- fix replace error on mqtt
Signed-off-by: ale <ale@metaverso.org>
* fix cassandra test
Signed-off-by: ale <ale@metaverso.org>
* fix ws test with invalid subtopic
Signed-off-by: ale <ale@metaverso.org>
* fix invalid GOCACHE in go1.12, replaced by -count 1, see https://golang.org/doc/go1.10#test
Signed-off-by: ale <ale@metaverso.org>
* - improve regexp on http/ws api/transport
- minor changes
Signed-off-by: ale <ale@metaverso.org>
* - add generic function parseSubtopic on ws/http adapters
Signed-off-by: ale <ale@metaverso.org>
* - add generic function fmtSubtopic on coap adapter
Signed-off-by: ale <ale@metaverso.org>
* 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>