Commit Graph

15 Commits

Author SHA1 Message Date
Nick Neisen 76908d7c8b MF-898 - Add bulk connect to CLI and SDK (#956)
* Add bulk connect to CLI and SDK

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add test for bulk connect

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add file example

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add JSON example to CLI docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change some value datatypes back

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Use constants for file extensions

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-21 12:29:37 +01:00
Nick Neisen 8f3dff837b MF-484 - Add bulk provisioning for things and channels (#889)
* Add provisioning to postgres

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add provisioning to things and channels service

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add JSON provisioning endpoint to things API

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add provisioning to SDK and CLI

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Remove response location and adjust channelsFromFile

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change naming from 'provison' to 'bulkCreate'

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add gocsv to vendors folder

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update "bulk" naming

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Move CSV to CLI and remove gocsv dependancy

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs and responses

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change AddThings to be CreateThings

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Improve test coverage

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Fixes after review

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-29 12:59:54 +01:00
Nick Neisen 66487eda42 MF-788 - Remove date and minimize copyright comments (#876)
* Update copyright comment for go files

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Update copyright in assortment of file types

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Remove missed copyright date

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-07 16:14:47 +02:00
Manuel Imperiale 63de955a7c
NOISSUE - Add searchable Channels name (#754)
* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add searchable Channels name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-06-11 10:37:25 +02:00
Manuel Imperiale c8979ac297
NOISSUE - Add searchable Things name (#750)
* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add name in ListThings loggins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add invalidName var for tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Set maxNameSize to 1024

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix postgres test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix total when filtering things by name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-30 15:33:49 +02:00
Manuel Imperiale 9f1151b8dc NOISSUE - Add readers pagination in SDK (#736)
* NOISSUE - Add readers pagination in SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-07 15:10:02 +02:00
Manuel Imperiale b97deb50b2 MF-488 - Remove Thing type (app or device) (#718)
* MF-488 - Remove Thing type (app or device)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-04-20 14:09:11 +02:00
Aleksandar Novaković 5799356b14 MF-549 - Change metadata format from JSON string to JSON object (#706)
* Update metadata type in things service

Update things service so that metadata has map type. Update repo
implementation by adding sqlx lib.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add sqlx lib to bootstrap service

Add sqlx lib to bootstrap service and update metadata field type.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update metadata in redis streams consumer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update tests for bootstrap service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader logging and driver version

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader and writer

Fix mongo reader and writer by updating driver version.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SDK with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update LoRa adapter with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update users service in order to use sqlx

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Replace anonymous struct with map

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update docs for LoRa adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix LoRa application metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix metadata format in LoRa docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata2 var to SDK things test

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-16 14:58:56 +02:00
Dušan Borovčanin 3f3b42b511 MF-519 - Refine Message (#567)
* Enable Message JSON mashaling/unmarshaling

Update Protobuf generated files.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>

* Update readers and SDK to use Mainflux Message

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>

* Fix alignment

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-06 13:57:12 +01:00
Aleksandar Novaković ea1993665d MF-483 - Enable channels and devices corresponding lists in backend (#520)
* Add list channels by thing id endpoint

Add list channels by thing id endpoint to things service. Add
pagination format and logic.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add fetch channels by thing endpoint

Add fetch channels by thing endpoint with pagination.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update list endpoints to contain pagination

Update list endpoints to contain pagination metadata.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add tests for two new endpoints

Add tests for two new endpoints and update existing ones. Also,
remove connected field from channel response.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix tests for SDK

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add SDK methods for new endpoints

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update swagger docs for things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add error handling to http tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix response body in http tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove unused responses from things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add test cases to things postgres tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add test cases for event sourcing

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-08 11:53:24 +01:00
Manuel Imperiale 655141e941 MF-433 - Add method for reading messages from readers to SDK. (#511)
* MF-433 - Add method for reading messages from readers to SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add messages read command on CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-18 22:04:34 +01:00
Aleksandar Novaković 671c32affe
MF-473 - Add metadata field to channel (#476)
* Add metadata field to channels and update things metadata

Add metadata field to channels. Update thing metadata field to be
in JSON format. Update tests..

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata to channel events

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata field to channel in go SDK

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-28 15:58:48 +01:00
Ivan Milošević ee262b9647 MF-417 - Implement SDK tests (#438)
* Add SKD tests for creating channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for Channel function

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add list channels over SDK tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for updating channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for deleting channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add users service SDK tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* SDK things tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK test for connecting and disconnecting things from channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* testing SDK sending messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add tests for SDK func SetContentType

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add all test cases for sending messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add handling StatusBadRequest when deleting thing over SDK

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update error responses when deleting channel and thing

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Removed unused Unauthorized response when creating user

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* update testing CreateChannel, tests if response is some string

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add bad request case in testing CreateToken

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove response error conflict from things service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix definition of sdk.ErrFailedDisconnect and return error in test cases for disconnecting things

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add handling errors and formatting code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Defined new ErrFailedPublish error in SDK

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK test for version

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Delete unused http response status in sdk.DeleteChannel

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-11-19 21:27:01 +01:00
Aleksandar Novaković ad5c66fad2 NOISSUE - Refactor SDK and things service (#420)
* 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>
2018-10-24 10:21:03 +01:00
Drasko DRASKOVIC a8eb7ae039
MF-354 - Add Go SDK (#357)
* MF-354 - Add Go SDK

This PR adds Go SDK. It also refactors `cli` to use new SDK.

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Use http consts. Add doc.

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Insline const

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Add initial SDK tests

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix SDK to return values (not HTTP rsp)

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix CLI and test

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* fix typos, add header

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix doc

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix doc, add comment

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Inline error checks

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix typos

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Inline errs

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix typo

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Change fnc parameter name

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Rename getters to Go standard

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Use struct and interface

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Simplify sdk struct

Signed-off-by: drasko <drasko.draskovic@gmail.com>

* Fix README

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-10-14 16:44:21 +02:00