custom interface; strategy pattern; service configuration; refactor

This commit is contained in:
A.Unger
2020-02-03 22:54:33 +01:00
parent bdc66633dd
commit 35d9deb38a
10 changed files with 94 additions and 99 deletions
+3 -4
View File
@@ -1,15 +1,15 @@
package grpc
// package grpc uses `ocis-pkg` to start a go-micro service
import (
"context"
"github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/proto/v0"
svc "github.com/owncloud/ocis-accounts/pkg/service/v0"
"github.com/owncloud/ocis-pkg/service/grpc"
)
// NewService initializes a new go-micro service ready to run
// NewService creates a grpc service
func NewService(c context.Context) grpc.Service {
service := grpc.NewService(
grpc.Name("accounts"),
@@ -18,8 +18,7 @@ func NewService(c context.Context) grpc.Service {
grpc.Context(c),
)
// add a handler to the service
hdlr := svc.New()
hdlr := svc.New(config.New())
proto.RegisterSettingsServiceHandler(service.Server(), hdlr)
service.Init()