mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-27 22:41:10 -05:00
add initial nats and kubernetes registry support
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -5,7 +5,9 @@ import (
|
||||
"strings"
|
||||
|
||||
etcdr "github.com/asim/go-micro/plugins/registry/etcd/v3"
|
||||
kubernetesr "github.com/asim/go-micro/plugins/registry/kubernetes/v3"
|
||||
mdnsr "github.com/asim/go-micro/plugins/registry/mdns/v3"
|
||||
natsr "github.com/asim/go-micro/plugins/registry/nats/v3"
|
||||
|
||||
"github.com/asim/go-micro/v3/registry"
|
||||
)
|
||||
@@ -23,6 +25,14 @@ func GetRegistry() registry.Registry {
|
||||
|
||||
var r registry.Registry
|
||||
switch os.Getenv(registryEnv) {
|
||||
case "nats":
|
||||
r = natsr.NewRegistry(
|
||||
registry.Addrs(addresses...),
|
||||
)
|
||||
case "kubernetes":
|
||||
r = kubernetesr.NewRegistry(
|
||||
registry.Addrs(addresses...),
|
||||
)
|
||||
case "etcd":
|
||||
r = etcdr.NewRegistry(
|
||||
registry.Addrs(addresses...),
|
||||
|
||||
Reference in New Issue
Block a user