Add possibility to provide version (#46)
This commit is contained in:
1 parent
44b236e2ef
commit
20b93f42d4
17 files changed
+122
-4
No files matched your search
@@ -0,0 +1,6 @@
|
||||
package Version
|
||||
|
||||
// Gets Ocean's version
|
||||
func GetVersion() string {
|
||||
return oceansVersion
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package Version
|
||||
|
||||
var (
|
||||
oceansVersion string = `2.0.0` // Ocean's current version
|
||||
)
|
||||
Reference in new issue
Block a user