mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-26 13:48:53 +08:00

* Fix failed subscription handling in ws adapter Fix unsubscribing bug in ws adapter. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add subscription fail and publish fail test cases Update mock implementation to receive publish error in order to support these test cases. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update mainflux version to 0.2.3 Update project version and load tests version to 0.2.3. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update version endpoint response format Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
25 lines
463 B
Go
25 lines
463 B
Go
package mainflux
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
const version string = "0.2.3"
|
|
|
|
type response struct {
|
|
Service string `json:"service"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// Version exposes an HTTP handler for retrieving service version.
|
|
func Version(service string) http.HandlerFunc {
|
|
return http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
|
|
res := response{service, version}
|
|
|
|
data, _ := json.Marshal(res)
|
|
|
|
rw.Write(data)
|
|
})
|
|
}
|