toss config struct around

This commit is contained in:
A.Unger committed 2020-02-04 10:16:12 +01:00
1 parent 7431297a1c
commit 2ff87de71f
3 files changed
+7 -3

No files matched your search

+4 -2
View File
@@ -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()),
},
}
+2 -1
View File
@@ -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",
+1
View File
@@ -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"),