Go to file
2021-09-06 22:11:38 +02:00
.github/workflows chore: update github actions 2021-07-28 16:51:53 +02:00
config fix: use IsSet 2021-06-16 12:04:39 +02:00
demo docs: add demo 2021-05-26 10:06:24 +02:00
env initial commit 2021-05-18 08:34:47 +02:00
examples/sessionid wip: generic session handler 2021-09-03 16:36:41 +02:00
log feat: add server name field 2021-09-06 22:09:36 +02:00
metrics initial commit 2021-05-18 08:34:47 +02:00
net feat: add cookie 2021-09-06 22:11:38 +02:00
telemetry feat: use trace provider interface and noop tracer when disabled 2021-05-26 09:59:55 +02:00
utils/net/http refactor: split up auth middlewares 2021-09-06 22:11:04 +02:00
.editorconfig initial commit 2021-05-18 08:34:47 +02:00
.gitignore chore: exclude temp folder 2021-09-06 19:26:06 +02:00
.golangci.yml chore: exclude tests 2021-09-06 19:28:54 +02:00
closer.go feat: add unsubscriber 2021-09-06 22:02:34 +02:00
go.mod added bcrypt based basic authentication 2021-08-17 14:36:24 +02:00
go.sum added bcrypt based basic authentication 2021-08-17 14:36:24 +02:00
ldflags.go initial commit 2021-05-18 08:34:47 +02:00
LICENSE docs: add license 2021-07-26 15:58:31 +02:00
Makefile feat: add log and telemetry closers by default 2021-05-20 07:34:22 +02:00
option.go feat: add service options 2021-09-06 22:03:39 +02:00
README.md docs: add badges 2021-07-26 16:01:02 +02:00
server_test.go docs: add comments 2021-08-11 14:03:00 +02:00
server.go feat: add unsubscriber 2021-09-06 22:02:34 +02:00
service_http_prometheus.go revert: remove service name 2021-05-26 10:04:06 +02:00
service_http_viper.go revert: remove service name 2021-05-26 10:04:06 +02:00
service_http_zap.go feat: add dynamic disableStacktrace and disableCaller handler 2021-08-11 13:40:42 +02:00
service_http.go revert: remove service name 2021-05-26 10:04:06 +02:00
service.go initial commit 2021-05-18 08:34:47 +02:00

keel

Go Report Card godoc GitHub Super-Linter

Opinionated way to run services.

Stack

  • Metrics: Prometheus
  • Logging: Zap
  • Telemetry: Open Telemetry
  • Configuration: Viper

Example

package main

import (
	"net/http"
	"os"

	"github.com/foomo/keel"
	"github.com/foomo/keel/log"
)

func main() {
	svr := keel.NewServer()

	l := svr.Logger()

	// add zap service listening on localhost:9100
	// allows you to view / change the log level: GET / PUT localhost:9100/log
	svr.AddServices(keel.NewDefaultServiceHTTPZap())

	// add viper service listening on localhost:9300
	// allows you to view / change the configuration: GET / PUT localhost:9300/config
	svr.AddServices(keel.NewDefaultServiceHTTPViper())

	// add prometheus service listening on 0.0.0.0:9200
	// allows you to collect prometheus metrics: GET 0.0.0.0:9200/metrics
	svr.AddServices(keel.NewDefaultServiceHTTPPrometheus())

	svr.AddService(
		keel.NewServiceHTTP(log.WithServiceName(l, "demo"), ":8080", newService()),
	)

	svr.Run()
}

func newService() *http.ServeMux {
	s := http.NewServeMux()
	s.HandleFunc("/panic", func(w http.ResponseWriter, r *http.Request) {
		panic("exiting")
	})
	s.HandleFunc("/exit", func(w http.ResponseWriter, r *http.Request) {
		os.Exit(1)
	})
	return s
}

How to Contribute

Make a pull request...

License

Distributed under MIT License, please see license file within the code for more details.