* Add event sourcing middleware for things service
Add event sourcing for write operations over things and channels.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Add tests for event sourcing middleware
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update things in tests to contain metadata field
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Refactor Mainflux go SDK
Add structures instead of string parameters. Add offset and limit
parameters to things and channels methods. Add better configuration
support.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Add new public errors with better error handling
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update SDK to use uint instread of string id
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update cli to use new SDK API
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Remove TLS termination from nginx configuration
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update SDK documentation and structures
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Refactor things service
Decouple HTTP layer from business logic. Remove ID number validation
check. Remove models from HTTP requests and responses.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Reformat tests for things service
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Increase test coverage for things service
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Add test
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* MF-384 - Add test for Redis cache
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add copyright headers
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Fix copyright header
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Fix test setup
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* handling errors and put test cases in maps instead of slices
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test case if thing already exists
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Fix TestThingSave to use require instead of assert
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Add test case for removing non-existing thing from cache
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Use table of test cases for Remove and test Connect for every case
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Use table of test cases for Save
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Test cases in slice instead of map for testing Remove
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Make test-cases independent, use asserts instead of requires
Signed-off-by: Ivan Milošević <iva@blokovi.com>
* Use slice and map where appropriate
Signed-off-by: Ivan Milošević <iva@blokovi.com>