Files
opencloud/services/storage-users/pkg/event/event.go
jkoberg 49cdcad129 unify eventstream creation
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-08-16 10:14:12 +02:00

19 lines
597 B
Go

package event
import (
"github.com/cs3org/reva/v2/pkg/events/stream"
"github.com/owncloud/ocis/v2/services/storage-users/pkg/config"
"go-micro.dev/v4/events"
)
// NewStream prepares the requested nats stream and returns it.
func NewStream(cfg *config.Config) (events.Stream, error) {
return stream.NatsFromConfig(cfg.Service.Name, stream.NatsConfig{
Endpoint: cfg.Events.Addr,
Cluster: cfg.Events.ClusterID,
EnableTLS: cfg.Events.EnableTLS,
TLSInsecure: cfg.Events.TLSInsecure,
TLSRootCACertificate: cfg.Events.TLSRootCaCertPath,
})
}