comment out http service for obvious reasons

This commit is contained in:
A.Unger
2020-04-16 12:59:55 +02:00
parent a02480062f
commit f8f9d1b7b2
+49 -49
View File
@@ -1,56 +1,56 @@
package http
// package http
import (
svc "github.com/owncloud/ocis-settings/pkg/service/v0"
"github.com/owncloud/ocis-settings/pkg/version"
"github.com/owncloud/ocis-pkg/v2/middleware"
"github.com/owncloud/ocis-pkg/v2/service/http"
)
// import (
// svc "github.com/owncloud/ocis-settings/pkg/service/v0"
// "github.com/owncloud/ocis-settings/pkg/version"
// "github.com/owncloud/ocis-pkg/v2/middleware"
// "github.com/owncloud/ocis-pkg/v2/service/http"
// )
// Server initializes the http service and server.
func Server(opts ...Option) (http.Service, error) {
options := newOptions(opts...)
// // Server initializes the http service and server.
// func Server(opts ...Option) (http.Service, error) {
// options := newOptions(opts...)
service := http.NewService(
http.Logger(options.Logger),
http.Name("settings"),
http.Version(version.String),
http.Namespace(options.Config.HTTP.Namespace),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
)
// service := http.NewService(
// http.Logger(options.Logger),
// http.Name("settings"),
// http.Version(version.String),
// http.Namespace(options.Config.HTTP.Namespace),
// http.Address(options.Config.HTTP.Addr),
// http.Context(options.Context),
// http.Flags(options.Flags...),
// )
handle := svc.NewService(
svc.Logger(options.Logger),
svc.Config(options.Config),
svc.Middleware(
middleware.RealIP,
middleware.RequestID,
middleware.Cache,
middleware.Cors,
middleware.Secure,
middleware.Version(
"settings",
version.String,
),
middleware.Logger(
options.Logger,
),
),
)
// handle := svc.NewService(
// svc.Logger(options.Logger),
// svc.Config(options.Config),
// svc.Middleware(
// middleware.RealIP,
// middleware.RequestID,
// middleware.Cache,
// middleware.Cors,
// middleware.Secure,
// middleware.Version(
// "settings",
// version.String,
// ),
// middleware.Logger(
// options.Logger,
// ),
// ),
// )
{
handle = svc.NewInstrument(handle, options.Metrics)
handle = svc.NewLogging(handle, options.Logger)
handle = svc.NewTracing(handle)
}
// {
// handle = svc.NewInstrument(handle, options.Metrics)
// handle = svc.NewLogging(handle, options.Logger)
// handle = svc.NewTracing(handle)
// }
service.Handle(
"/",
handle,
)
// service.Handle(
// "/",
// handle,
// )
service.Init()
return service, nil
}
// service.Init()
// return service, nil
// }