mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
19 lines
306 B
Go
19 lines
306 B
Go
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
type ServiceInfo struct {
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
func InfoHandler(info ServiceInfo) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
if err := json.NewEncoder(w).Encode(info); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
}
|