Add possibility to provide version (#46)

This commit is contained in:
Thorsten Sommer committed 2015-07-10 16:20:10 +02:00
1 parent 44b236e2ef
commit 20b93f42d4
17 files changed
+122 -4

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
package Version
// Gets Ocean's version
func GetVersion() string {
return oceansVersion
}
+19
View File
@@ -0,0 +1,19 @@
package Version
import (
"fmt"
"github.com/SommerEngineering/Ocean/Shutdown"
"net/http"
)
// Handler for the access to Ocean's version
func HandlerVersion(response http.ResponseWriter, request *http.Request) {
// Case: The system goes down now?
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
fmt.Fprintf(response, "%s", oceansVersion)
}
+5
View File
@@ -0,0 +1,5 @@
package Version
var (
oceansVersion string = `2.0.0` // Ocean's current version
)