mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 19:29:49 -06:00
Separate out grpc client to package local for ocs service.
This commit is contained in:
@@ -35,7 +35,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
err = ogrpc.Configure(ogrpc.GetClientOptions(cfg.GRPCClientTLS)...)
|
||||
cfg.GrpcClient, err = ogrpc.NewClient(ogrpc.GetClientOptions(cfg.GRPCClientTLS)...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
@@ -19,6 +20,7 @@ type Config struct {
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
|
||||
GrpcClient client.Client `yaml:"-"`
|
||||
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0"
|
||||
|
||||
revactx "github.com/cs3org/reva/v2/pkg/ctx"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
|
||||
"github.com/owncloud/ocis/v2/services/ocs/pkg/service/v0/data"
|
||||
"github.com/owncloud/ocis/v2/services/ocs/pkg/service/v0/response"
|
||||
merrors "go-micro.dev/v4/errors"
|
||||
@@ -29,7 +28,7 @@ func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request) {
|
||||
// use the user's UUID
|
||||
userID := u.Id.OpaqueId
|
||||
|
||||
c := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient())
|
||||
c := storesvc.NewStoreService("com.owncloud.api.store", o.config.GrpcClient)
|
||||
res, err := c.Read(r.Context(), &storesvc.ReadRequest{
|
||||
Options: &storemsg.ReadOptions{
|
||||
Database: "proxy",
|
||||
|
||||
Reference in New Issue
Block a user