mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
1.2 KiB
1.2 KiB
keel
Opinionated way to run services.
Stack
- Zap
- Viper
- Open Telemetry
- Nats
- GoTSRPC
Examples
See the examples folder for usages
package main
import (
"net/http"
"github.com/foomo/keel"
)
func main() {
svr := keel.NewServer(
keel.WithHTTPZapService(true),
keel.WithHTTPViperService(true),
keel.WithHTTPPrometheusService(true),
)
l := svr.Logger()
svs := newService()
svr.AddService(
keel.NewServiceHTTP(l, "demo", ":8080", svs),
)
svr.Run()
}
func newService() *http.ServeMux {
s := http.NewServeMux()
s.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("OK"))
})
return s
}
How to Contribute
Make a pull request...
License
Distributed under MIT License, please see license file within the code for more details.