We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23e7cd4 commit d43b8d3Copy full SHA for d43b8d3
sharedapi/go.mod
@@ -0,0 +1,3 @@
1
+module github.com/formancehq/go-libs/sharedapi
2
+
3
+go 1.19
sharedapi/handler_info.go
@@ -0,0 +1,18 @@
+package sharedapi
+import (
4
+ "encoding/json"
5
+ "net/http"
6
+)
7
8
+type ServiceInfo struct {
9
+ Version string `json:"version"`
10
+}
11
12
+func InfoHandler(info ServiceInfo) http.HandlerFunc {
13
+ return func(w http.ResponseWriter, r *http.Request) {
14
+ if err := json.NewEncoder(w).Encode(info); err != nil {
15
+ panic(err)
16
+ }
17
18
0 commit comments