add version command and add build information to metrics

Signed-off-by: David Christofas <dchristofas@owncloud.com>
This commit is contained in:
David Christofas
2020-09-25 13:52:03 +02:00
parent ff8fc23ce5
commit be71b844f2
10 changed files with 119 additions and 14 deletions
+6 -7
View File
@@ -1,10 +1,9 @@
package http
import (
svc "github.com/owncloud/ocis/ocs/pkg/service/v0"
"github.com/owncloud/ocis/ocs/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
svc "github.com/owncloud/ocis/ocs/pkg/service/v0"
)
// Server initializes the http service and server.
@@ -13,9 +12,9 @@ func Server(opts ...Option) (http.Service, error) {
service := http.NewService(
http.Logger(options.Logger),
http.Name("ocs"),
http.Version(version.String),
http.Namespace(options.Config.HTTP.Namespace),
http.Name(options.Config.Service.Name),
http.Version(options.Config.Service.Version),
http.Namespace(options.Config.Service.Namespace),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
@@ -31,8 +30,8 @@ func Server(opts ...Option) (http.Service, error) {
middleware.Cors,
middleware.Secure,
middleware.Version(
"ocs",
version.String,
options.Config.Service.Name,
options.Config.Service.Version,
),
middleware.Logger(
options.Logger,