From f7454e576aef48e0fffee9872c92c3e5ca8ebf43 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 23 Sep 2025 12:47:36 +0200 Subject: [PATCH] remove obsolete properties Signed-off-by: Christian Richter --- services/graph/pkg/command/server.go | 13 ------------- services/graph/pkg/config/config.go | 11 ++++------- services/graph/pkg/config/defaults/defaultconfig.go | 2 -- services/graph/pkg/server/http/option.go | 9 --------- services/graph/pkg/server/http/server.go | 1 - services/graph/pkg/service/v0/option.go | 9 --------- services/graph/pkg/service/v0/service.go | 1 - 7 files changed, 4 insertions(+), 42 deletions(-) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 2d43483dc..7a10c42cf 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -15,10 +15,6 @@ import ( "github.com/opencloud-eu/opencloud/services/graph/pkg/metrics" "github.com/opencloud-eu/opencloud/services/graph/pkg/server/debug" "github.com/opencloud-eu/opencloud/services/graph/pkg/server/http" - microstore "go-micro.dev/v4/store" - - "github.com/opencloud-eu/reva/v2/pkg/store" - "github.com/urfave/cli/v2" ) @@ -50,18 +46,9 @@ func Server(cfg *config.Config) *cli.Command { gr := runner.NewGroup() { - persistence := store.Create( - store.Store(cfg.Store.Store), - microstore.Nodes(cfg.Store.Nodes...), - microstore.Database(cfg.Store.Database), - microstore.Table(cfg.Store.Table), - store.Authentication(cfg.Store.AuthUsername, cfg.Store.AuthPassword), - ) - server, err := http.Server( http.Logger(logger), http.Context(ctx), - http.Store(persistence), http.Config(cfg), http.Metrics(mtrcs), http.TraceProvider(traceProvider), diff --git a/services/graph/pkg/config/config.go b/services/graph/pkg/config/config.go index 1d92cb2a5..e95c3e652 100644 --- a/services/graph/pkg/config/config.go +++ b/services/graph/pkg/config/config.go @@ -173,11 +173,8 @@ type Metadata struct { // Store configures the store to use type Store struct { - Store string `yaml:"store" env:"OC_PERSISTENT_STORE;GRAPH_STORE" desc:"The type of the store. Supported values are: 'memory', 'nats-js-kv', 'redis-sentinel', 'noop'. See the text description for details." introductionVersion:"1.0.0"` - Nodes []string `yaml:"nodes" env:"OC_PERSISTENT_STORE_NODES;GRAPH_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` - Database string `yaml:"database" env:"GRAPH_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"` - Table string `yaml:"table" env:"GRAPH_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"1.0.0"` - TTL time.Duration `yaml:"ttl" env:"OC_PERSISTENT_STORE_TTL;GRAPH_STORE_TTL" desc:"Time to live for events in the store. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` - AuthUsername string `yaml:"username" env:"OC_PERSISTENT_STORE_AUTH_USERNAME;GRAPH_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` - AuthPassword string `yaml:"password" env:"OC_PERSISTENT_STORE_AUTH_PASSWORD;GRAPH_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` + Nodes []string `yaml:"nodes" env:"OC_PERSISTENT_STORE_NODES;GRAPH_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` + Database string `yaml:"database" env:"GRAPH_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"` + AuthUsername string `yaml:"username" env:"OC_PERSISTENT_STORE_AUTH_USERNAME;GRAPH_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` + AuthPassword string `yaml:"password" env:"OC_PERSISTENT_STORE_AUTH_PASSWORD;GRAPH_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` } diff --git a/services/graph/pkg/config/defaults/defaultconfig.go b/services/graph/pkg/config/defaults/defaultconfig.go index b4807319d..d840868bf 100644 --- a/services/graph/pkg/config/defaults/defaultconfig.go +++ b/services/graph/pkg/config/defaults/defaultconfig.go @@ -132,10 +132,8 @@ func DefaultConfig() *config.Config { }, UserSoftDeleteRetentionTime: 0, Store: config.Store{ - Store: "nats-js-kv", Nodes: []string{"127.0.0.1:9233"}, Database: "graph", - Table: "", }, } } diff --git a/services/graph/pkg/server/http/option.go b/services/graph/pkg/server/http/option.go index e384b87e6..e4151518a 100644 --- a/services/graph/pkg/server/http/option.go +++ b/services/graph/pkg/server/http/option.go @@ -7,7 +7,6 @@ import ( "github.com/opencloud-eu/opencloud/services/graph/pkg/config" "github.com/opencloud-eu/opencloud/services/graph/pkg/metrics" "github.com/urfave/cli/v2" - microstore "go-micro.dev/v4/store" "go.opentelemetry.io/otel/trace" ) @@ -23,7 +22,6 @@ type Options struct { Flags []cli.Flag Namespace string TraceProvider trace.TracerProvider - Store microstore.Store } // newOptions initializes the available default options. @@ -79,13 +77,6 @@ func Namespace(val string) Option { } } -// Store configures the store to use -func Store(store microstore.Store) Option { - return func(o *Options) { - o.Store = store - } -} - // TraceProvider provides a function to set the TraceProvider option. func TraceProvider(val trace.TracerProvider) Option { return func(o *Options) { diff --git a/services/graph/pkg/server/http/server.go b/services/graph/pkg/server/http/server.go index d5ccf2b50..cfa43c231 100644 --- a/services/graph/pkg/server/http/server.go +++ b/services/graph/pkg/server/http/server.go @@ -178,7 +178,6 @@ func Server(opts ...Option) (http.Service, error) { svc.KeycloakClient(keyCloakClient), svc.EventHistoryClient(hClient), svc.TraceProvider(options.TraceProvider), - svc.Store(options.Store), ) if err != nil { diff --git a/services/graph/pkg/service/v0/option.go b/services/graph/pkg/service/v0/option.go index 516e7b55c..b4ffa0ed2 100644 --- a/services/graph/pkg/service/v0/option.go +++ b/services/graph/pkg/service/v0/option.go @@ -7,7 +7,6 @@ import ( gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" "github.com/opencloud-eu/reva/v2/pkg/events" "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool" - microstore "go-micro.dev/v4/store" "go.opentelemetry.io/otel/trace" "github.com/opencloud-eu/opencloud/pkg/keycloak" @@ -43,7 +42,6 @@ type Options struct { SearchService searchsvc.SearchProviderService KeycloakClient keycloak.Client EventHistoryClient ehsvc.EventHistoryService - Store microstore.Store TraceProvider trace.TracerProvider } @@ -177,13 +175,6 @@ func EventHistoryClient(val ehsvc.EventHistoryService) Option { } } -// Store configures the store to use -func Store(store microstore.Store) Option { - return func(o *Options) { - o.Store = store - } -} - // TraceProvider provides a function to set the TraceProvider option. func TraceProvider(val trace.TracerProvider) Option { return func(o *Options) { diff --git a/services/graph/pkg/service/v0/service.go b/services/graph/pkg/service/v0/service.go index 34f718d79..b7358b03a 100644 --- a/services/graph/pkg/service/v0/service.go +++ b/services/graph/pkg/service/v0/service.go @@ -4,7 +4,6 @@ import ( "context" "crypto/tls" "crypto/x509" - "errors" "fmt" "net/http" "os"