1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00
Mainflux.mainflux/version.go
Nikola Marčetić bd3c24ed83 Version updated (#450)
* Version updated

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Updated load test version

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2018-11-08 10:44:12 +01:00

32 lines
552 B
Go

//
// Copyright (c) 2018
// Mainflux
//
// SPDX-License-Identifier: Apache-2.0
//
package mainflux
import (
"encoding/json"
"net/http"
)
const version string = "0.6.0"
type VersionInfo 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 := VersionInfo{service, version}
data, _ := json.Marshal(res)
rw.Write(data)
})
}