1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-28 13:48:49 +08:00
Mainflux.mainflux/version.go
Dejan Mijic 52ab91c275
Update the API documentation of manager service
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2017-12-29 10:22:37 +01:00

26 lines
562 B
Go

// Package mainflux acts as an umbrella package containing multiple different
// microservices / deliverables. It provides the top-level platform versioning.
package mainflux
import (
"encoding/json"
"net/http"
)
const version string = "1.0.0-rc.1"
type response struct {
Version string
}
// Version exposes an HTTP handler for retrieving service version.
func Version() http.HandlerFunc {
return http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
res := response{Version: version}
data, _ := json.Marshal(res)
rw.Write(data)
})
}