add version command and add build information to metrics
Signed-off-by: David Christofas <dchristofas@owncloud.com>
This commit is contained in:
@@ -22,7 +22,6 @@ type Options struct {
|
||||
Handler http.Handler
|
||||
Metrics *metrics.Metrics
|
||||
Flags []cli.Flag
|
||||
Namespace string
|
||||
Middlewares alice.Chain
|
||||
}
|
||||
|
||||
@@ -72,13 +71,6 @@ func Flags(val []cli.Flag) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Namespace provides a function to set the namespace option.
|
||||
func Namespace(val string) Option {
|
||||
return func(o *Options) {
|
||||
o.Namespace = val
|
||||
}
|
||||
}
|
||||
|
||||
// Handler provides a function to set the Handler option.
|
||||
func Handler(h http.Handler) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
svc "github.com/owncloud/ocis/ocis-pkg/service/http"
|
||||
"github.com/owncloud/ocis/proxy/pkg/crypto"
|
||||
"github.com/owncloud/ocis/proxy/pkg/version"
|
||||
)
|
||||
|
||||
// Server initializes the http service and server.
|
||||
@@ -48,11 +47,11 @@ func Server(opts ...Option) (svc.Service, error) {
|
||||
chain := options.Middlewares.Then(options.Handler)
|
||||
|
||||
service := svc.NewService(
|
||||
svc.Name("web.proxy"),
|
||||
svc.Name(options.Config.Service.Name),
|
||||
svc.TLSConfig(tlsConfig),
|
||||
svc.Logger(options.Logger),
|
||||
svc.Namespace(options.Namespace),
|
||||
svc.Version(version.String),
|
||||
svc.Namespace(options.Config.Service.Namespace),
|
||||
svc.Version(options.Config.Service.Version),
|
||||
svc.Address(options.Config.HTTP.Addr),
|
||||
svc.Context(options.Context),
|
||||
svc.Flags(options.Flags...),
|
||||
|
||||
Reference in New Issue
Block a user