introduce natsjs registry
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
mdnsr "github.com/go-micro/plugins/v4/registry/mdns"
|
||||
memr "github.com/go-micro/plugins/v4/registry/memory"
|
||||
natsr "github.com/go-micro/plugins/v4/registry/nats"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/natsjsregistry"
|
||||
mRegistry "go-micro.dev/v4/registry"
|
||||
"go-micro.dev/v4/registry/cache"
|
||||
)
|
||||
@@ -28,6 +29,7 @@ var (
|
||||
reg mRegistry.Registry
|
||||
)
|
||||
|
||||
// Configure configures the registry
|
||||
func Configure(plugin string) {
|
||||
if reg == nil {
|
||||
regPlugin = plugin
|
||||
@@ -66,6 +68,10 @@ func GetRegistry() mRegistry.Registry {
|
||||
)
|
||||
case "memory":
|
||||
reg = memr.NewRegistry()
|
||||
case "natsjs":
|
||||
reg = natsjsregistry.NewRegistry(
|
||||
mRegistry.Addrs(addresses...),
|
||||
)
|
||||
default:
|
||||
reg = mdnsr.NewRegistry()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user