diff --git a/pkg/command/root.go b/pkg/command/root.go index 01f884660..66369097c 100644 --- a/pkg/command/root.go +++ b/pkg/command/root.go @@ -4,9 +4,11 @@ import ( "os" "github.com/micro/cli/v2" + "github.com/owncloud/ocis-accounts/pkg/config" + "github.com/owncloud/ocis-hello/pkg/version" + // init store manager _ "github.com/owncloud/ocis-accounts/pkg/store" - "github.com/owncloud/ocis-hello/pkg/version" ) // Execute is the entry point for the ocis-accounts command. @@ -24,7 +26,7 @@ func Execute() error { }, Commands: []*cli.Command{ - Server(), + Server(config.New()), }, } diff --git a/pkg/command/server.go b/pkg/command/server.go index a0a867f7f..b997157eb 100644 --- a/pkg/command/server.go +++ b/pkg/command/server.go @@ -7,11 +7,12 @@ import ( "github.com/micro/cli/v2" "github.com/oklog/run" + "github.com/owncloud/ocis-accounts/pkg/config" "github.com/owncloud/ocis-accounts/pkg/micro/grpc" ) // Server is the entry point for the server command. -func Server() *cli.Command { +func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", Usage: "Start accounts service", diff --git a/pkg/micro/grpc/grpc.go b/pkg/micro/grpc/grpc.go index 874b69e2d..5676a56a9 100644 --- a/pkg/micro/grpc/grpc.go +++ b/pkg/micro/grpc/grpc.go @@ -12,6 +12,7 @@ import ( // NewService creates a grpc service func NewService(c context.Context) grpc.Service { service := grpc.NewService( + // TODO options come from configuration grpc.Name("accounts"), grpc.Namespace("com.owncloud"), grpc.Address("localhost:9999"),