add nats-js-kv connection to graph

Signed-off-by: Christian Richter <c.richter@opencloud.eu>

# Conflicts:
#	services/graph/pkg/service/v0/service.go
This commit is contained in:
Christian Richter
2025-10-08 16:45:16 +02:00
committed by Ralf Haferkamp
parent 63f976cac1
commit 07a9308c4c
6 changed files with 68 additions and 0 deletions
+9
View File
@@ -7,6 +7,7 @@ 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"
)
@@ -22,6 +23,7 @@ type Options struct {
Flags []cli.Flag
Namespace string
TraceProvider trace.TracerProvider
Store microstore.Store
}
// newOptions initializes the available default options.
@@ -77,6 +79,13 @@ 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) {
+1
View File
@@ -178,6 +178,7 @@ func Server(opts ...Option) (http.Service, error) {
svc.KeycloakClient(keyCloakClient),
svc.EventHistoryClient(hClient),
svc.TraceProvider(options.TraceProvider),
svc.Store(options.Store),
)
if err != nil {