mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-18 15:13:32 -05:00
28 lines
650 B
Go
28 lines
650 B
Go
package grpc
|
|
|
|
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 creates a grpc service
|
|
func NewService(c context.Context, cfg *config.Config) grpc.Service {
|
|
service := grpc.NewService(
|
|
// TODO options come from configuration
|
|
grpc.Name("accounts"),
|
|
grpc.Namespace("com.owncloud"),
|
|
grpc.Address("localhost:9999"),
|
|
grpc.Context(c),
|
|
)
|
|
|
|
hdlr := svc.New(cfg)
|
|
proto.RegisterSettingsServiceHandler(service.Server(), hdlr)
|
|
|
|
service.Init()
|
|
return service
|
|
}
|