enhancement: simplify ready and health check handler usage

This commit is contained in:
Florian Schade
2024-10-16 20:26:00 +02:00
parent 0ea4312668
commit 66ff86bd35
27 changed files with 207 additions and 82 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/ggwhite/go-masker"
"github.com/owncloud/ocis/v2/ocis-pkg/checks"
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
"github.com/owncloud/ocis/v2/ocis-pkg/service/debug"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
@@ -19,7 +20,7 @@ func Server(opts ...Option) (*http.Server, error) {
checkHandler := handlers.NewCheckHandler(
handlers.NewCheckHandlerConfiguration().
WithLogger(options.Logger).
WithCheck("web reachability", handlers.NewHTTPCheck(options.Config.HTTP.Addr)),
WithCheck("web reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr)),
)
var configDumpFunc http.HandlerFunc = configDump(options.Config)