diff --git a/services/activitylog/pkg/command/server.go b/services/activitylog/pkg/command/server.go index 96601df47..af4300a0e 100644 --- a/services/activitylog/pkg/command/server.go +++ b/services/activitylog/pkg/command/server.go @@ -9,6 +9,9 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/cs3org/reva/v2/pkg/store" "github.com/oklog/run" + "github.com/urfave/cli/v2" + microstore "go-micro.dev/v4/store" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/handlers" "github.com/owncloud/ocis/v2/ocis-pkg/registry" @@ -23,8 +26,6 @@ import ( "github.com/owncloud/ocis/v2/services/activitylog/pkg/logging" "github.com/owncloud/ocis/v2/services/activitylog/pkg/metrics" "github.com/owncloud/ocis/v2/services/activitylog/pkg/server/http" - "github.com/urfave/cli/v2" - microstore "go-micro.dev/v4/store" ) var _registeredEvents = []events.Unmarshaller{ @@ -120,7 +121,6 @@ func Server(cfg *config.Config) *cli.Command { http.Context(ctx), // NOTE: not passing this "option" leads to a panic in go-micro http.TraceProvider(tracerProvider), http.Stream(evStream), - http.RegisteredEvents(_registeredEvents), http.Store(evStore), http.GatewaySelector(gatewaySelector), http.HistoryClient(hClient), diff --git a/services/app-provider/pkg/server/debug/server.go b/services/app-provider/pkg/server/debug/server.go index 598a8e2f5..5686ae126 100644 --- a/services/app-provider/pkg/server/debug/server.go +++ b/services/app-provider/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/app-provider/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/app-registry/pkg/server/debug/server.go b/services/app-registry/pkg/server/debug/server.go index e85c77274..5686ae126 100644 --- a/services/app-registry/pkg/server/debug/server.go +++ b/services/app-registry/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/app-registry/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/auth-app/pkg/server/debug/server.go b/services/auth-app/pkg/server/debug/server.go index b87b7e52f..5686ae126 100644 --- a/services/auth-app/pkg/server/debug/server.go +++ b/services/auth-app/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/auth-app/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/auth-basic/pkg/server/debug/server.go b/services/auth-basic/pkg/server/debug/server.go index 18b2b02df..5686ae126 100644 --- a/services/auth-basic/pkg/server/debug/server.go +++ b/services/auth-basic/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/auth-bearer/pkg/server/debug/server.go b/services/auth-bearer/pkg/server/debug/server.go index fb65e4e16..5686ae126 100644 --- a/services/auth-bearer/pkg/server/debug/server.go +++ b/services/auth-bearer/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/auth-machine/pkg/server/debug/server.go b/services/auth-machine/pkg/server/debug/server.go index 4f7323733..5686ae126 100644 --- a/services/auth-machine/pkg/server/debug/server.go +++ b/services/auth-machine/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/auth-service/pkg/server/debug/server.go b/services/auth-service/pkg/server/debug/server.go index d4616cb0f..5686ae126 100644 --- a/services/auth-service/pkg/server/debug/server.go +++ b/services/auth-service/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/auth-service/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/collaboration/pkg/server/debug/server.go b/services/collaboration/pkg/server/debug/server.go index 89de71370..83e1ed1ea 100644 --- a/services/collaboration/pkg/server/debug/server.go +++ b/services/collaboration/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/collaboration/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/frontend/pkg/server/debug/server.go b/services/frontend/pkg/server/debug/server.go index 4c813dc4f..5686ae126 100644 --- a/services/frontend/pkg/server/debug/server.go +++ b/services/frontend/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/frontend/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/gateway/pkg/server/debug/server.go b/services/gateway/pkg/server/debug/server.go index 18ad6b6f4..5686ae126 100644 --- a/services/gateway/pkg/server/debug/server.go +++ b/services/gateway/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/gateway/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/graph/pkg/server/debug/server.go b/services/graph/pkg/server/debug/server.go index 314ef1b78..3f7159772 100644 --- a/services/graph/pkg/server/debug/server.go +++ b/services/graph/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/graph/pkg/config" ) // Server initializes the debug service and server. @@ -21,39 +20,7 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/groups/pkg/server/debug/server.go b/services/groups/pkg/server/debug/server.go index bf0fe346a..5686ae126 100644 --- a/services/groups/pkg/server/debug/server.go +++ b/services/groups/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/groups/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/idm/pkg/server/debug/server.go b/services/idm/pkg/server/debug/server.go index 9ac1972d4..3f7159772 100644 --- a/services/idm/pkg/server/debug/server.go +++ b/services/idm/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/idm/pkg/config" ) // Server initializes the debug service and server. @@ -21,39 +20,7 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/idp/pkg/server/debug/server.go b/services/idp/pkg/server/debug/server.go index f236bc69a..25d175bee 100644 --- a/services/idp/pkg/server/debug/server.go +++ b/services/idp/pkg/server/debug/server.go @@ -5,6 +5,7 @@ import ( "net/http" "net/url" + "github.com/owncloud/ocis/v2/ocis-pkg/handlers" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/service/debug" "github.com/owncloud/ocis/v2/ocis-pkg/shared" @@ -25,7 +26,7 @@ func Server(opts ...Option) (*http.Server, error) { debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), debug.Health(health(options.Config, options.Logger)), - debug.Ready(ready(options.Config)), + debug.Ready(handlers.Ready), ), nil } @@ -51,20 +52,3 @@ func health(cfg *config.Config, l log.Logger) func(http.ResponseWriter, *http.Re } } } - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - // if we can call this function, a http(200) is a valid response as - // there is nothing we can check at this point for IDP - // if there is a mishap when initializing, there is a minimal (talking ms or ns window) - // timeframe where this code is callable - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/invitations/pkg/server/debug/server.go b/services/invitations/pkg/server/debug/server.go index 663e3c45d..4b8e4a295 100644 --- a/services/invitations/pkg/server/debug/server.go +++ b/services/invitations/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/invitations/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/ocdav/pkg/server/debug/server.go b/services/ocdav/pkg/server/debug/server.go index 5216000a7..5686ae126 100644 --- a/services/ocdav/pkg/server/debug/server.go +++ b/services/ocdav/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/ocdav/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/ocm/pkg/server/debug/server.go b/services/ocm/pkg/server/debug/server.go index d97b3fde1..5686ae126 100644 --- a/services/ocm/pkg/server/debug/server.go +++ b/services/ocm/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/ocm/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/ocs/pkg/server/debug/server.go b/services/ocs/pkg/server/debug/server.go index 536c97245..4b8e4a295 100644 --- a/services/ocs/pkg/server/debug/server.go +++ b/services/ocs/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/ocs/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/policies/pkg/command/server.go b/services/policies/pkg/command/server.go index 5719335ae..6118381ad 100644 --- a/services/policies/pkg/command/server.go +++ b/services/policies/pkg/command/server.go @@ -3,12 +3,13 @@ package command import ( "context" "fmt" - "io" - "net/http" "github.com/cs3org/reva/v2/pkg/events/stream" "github.com/oklog/run" + "github.com/urfave/cli/v2" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" + "github.com/owncloud/ocis/v2/ocis-pkg/handlers" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/service/debug" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" @@ -20,7 +21,6 @@ import ( "github.com/owncloud/ocis/v2/services/policies/pkg/engine/opa" svcEvent "github.com/owncloud/ocis/v2/services/policies/pkg/service/event" svcGRPC "github.com/owncloud/ocis/v2/services/policies/pkg/service/grpc" - "github.com/urfave/cli/v2" ) // Server is the entrypoint for the server command. @@ -129,34 +129,8 @@ func Server(cfg *config.Config) *cli.Command { debug.Token(cfg.Debug.Token), debug.Pprof(cfg.Debug.Pprof), debug.Zpages(cfg.Debug.Zpages), - debug.Health( - func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - }, - ), - debug.Ready( - func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - }, - ), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), ) gr.Add(server.ListenAndServe, func(_ error) { diff --git a/services/proxy/pkg/server/debug/server.go b/services/proxy/pkg/server/debug/server.go index ae2a3349b..04d033048 100644 --- a/services/proxy/pkg/server/debug/server.go +++ b/services/proxy/pkg/server/debug/server.go @@ -2,10 +2,11 @@ package debug import ( "encoding/json" - "io" "net/http" - masker "github.com/ggwhite/go-masker" + "github.com/ggwhite/go-masker" + + "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" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" @@ -23,44 +24,12 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.ConfigDump(configDump(options.Config)), ), nil } -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - // configDump implements the config dump func configDump(cfg *config.Config) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { diff --git a/services/search/pkg/server/debug/server.go b/services/search/pkg/server/debug/server.go index e1ac53041..3f7159772 100644 --- a/services/search/pkg/server/debug/server.go +++ b/services/search/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/search/pkg/config" ) // Server initializes the debug service and server. @@ -21,39 +20,7 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/settings/pkg/server/debug/server.go b/services/settings/pkg/server/debug/server.go index 8b667f094..4b8e4a295 100644 --- a/services/settings/pkg/server/debug/server.go +++ b/services/settings/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/settings/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/sharing/pkg/server/debug/server.go b/services/sharing/pkg/server/debug/server.go index 818cf6012..5686ae126 100644 --- a/services/sharing/pkg/server/debug/server.go +++ b/services/sharing/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/sharing/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/storage-publiclink/pkg/server/debug/server.go b/services/storage-publiclink/pkg/server/debug/server.go index 4cf599ced..5686ae126 100644 --- a/services/storage-publiclink/pkg/server/debug/server.go +++ b/services/storage-publiclink/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/storage-shares/pkg/server/debug/server.go b/services/storage-shares/pkg/server/debug/server.go index 2f301be8b..5686ae126 100644 --- a/services/storage-shares/pkg/server/debug/server.go +++ b/services/storage-shares/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/storage-system/pkg/server/debug/server.go b/services/storage-system/pkg/server/debug/server.go index b5bc0977b..5686ae126 100644 --- a/services/storage-system/pkg/server/debug/server.go +++ b/services/storage-system/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/storage-system/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/storage-users/pkg/server/debug/server.go b/services/storage-users/pkg/server/debug/server.go index 268324919..8c5ce23fb 100644 --- a/services/storage-users/pkg/server/debug/server.go +++ b/services/storage-users/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" ) // Server initializes the debug service and server. @@ -22,43 +21,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/thumbnails/pkg/server/debug/server.go b/services/thumbnails/pkg/server/debug/server.go index 914167fac..4b8e4a295 100644 --- a/services/thumbnails/pkg/server/debug/server.go +++ b/services/thumbnails/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/users/pkg/server/debug/server.go b/services/users/pkg/server/debug/server.go index b10bacdc2..5686ae126 100644 --- a/services/users/pkg/server/debug/server.go +++ b/services/users/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/users/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), //debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), //debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), //debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), //debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/web/pkg/server/debug/server.go b/services/web/pkg/server/debug/server.go index 0ffe3259c..3f7159772 100644 --- a/services/web/pkg/server/debug/server.go +++ b/services/web/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/web/pkg/config" ) // Server initializes the debug service and server. @@ -21,39 +20,7 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), ), nil } - -// health implements the health check. -func health(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/webdav/pkg/server/debug/server.go b/services/webdav/pkg/server/debug/server.go index 8c4bd1c6c..4b8e4a295 100644 --- a/services/webdav/pkg/server/debug/server.go +++ b/services/webdav/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/webdav/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} diff --git a/services/webfinger/pkg/server/debug/server.go b/services/webfinger/pkg/server/debug/server.go index 2701befb1..4b8e4a295 100644 --- a/services/webfinger/pkg/server/debug/server.go +++ b/services/webfinger/pkg/server/debug/server.go @@ -1,12 +1,11 @@ package debug import ( - "io" "net/http" + "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" - "github.com/owncloud/ocis/v2/services/webfinger/pkg/config" ) // Server initializes the debug service and server. @@ -21,43 +20,11 @@ func Server(opts ...Option) (*http.Server, error) { debug.Token(options.Config.Debug.Token), debug.Pprof(options.Config.Debug.Pprof), debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), + debug.Health(handlers.Health), + debug.Ready(handlers.Ready), debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins), debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods), debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders), debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials), ), nil } - -// health implements the health check. -func health(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -} - -// ready implements the ready check. -func ready(_ *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO: check if services are up and running - - _, err := io.WriteString(w, http.StatusText(http.StatusOK)) - // io.WriteString should not fail but if it does, we want to know. - if err != nil { - panic(err) - } - } -}