Revive http service for serving assets. Streamlined flagset.

This commit is contained in:
Benedikt Kulmann
2020-04-21 22:43:22 +02:00
parent 4b612965d9
commit 2f42fcb35a
9 changed files with 148 additions and 194 deletions
+9 -6
View File
@@ -4,6 +4,7 @@ import (
"github.com/owncloud/ocis-settings/pkg/proto/v0"
svc "github.com/owncloud/ocis-settings/pkg/service/v0"
"github.com/owncloud/ocis-pkg/v2/service/grpc"
"github.com/owncloud/ocis-settings/pkg/version"
)
// NewService initializes a new go-micro service ready to run
@@ -11,15 +12,17 @@ func Server(opts ...Option) grpc.Service {
options := newOptions(opts...)
service := grpc.NewService(
grpc.Name(options.Name),
grpc.Context(options.Context),
grpc.Address(options.Address),
grpc.Namespace(options.Namespace),
grpc.Logger(options.Logger),
grpc.Name(options.Name),
grpc.Version(version.String),
grpc.Address(options.Config.GRPC.Addr),
grpc.Namespace(options.Config.GRPC.Namespace),
grpc.Context(options.Context),
grpc.Flags(options.Flags...),
)
hdlr := svc.NewService(options.Config)
if err := proto.RegisterBundleServiceHandler(service.Server(), hdlr); err != nil {
handle := svc.NewService(options.Config)
if err := proto.RegisterBundleServiceHandler(service.Server(), handle); err != nil {
options.Logger.Fatal().Err(err).Msg("could not register service handler")
}