1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-10-30 23:27:41 +02:00

Add etcd to default registries when plugin is loaded (#2150)

Co-authored-by: Andrew Jones <andrew@gotoblink.com>
This commit is contained in:
Andrew
2021-04-09 03:31:39 +10:00
committed by GitHub
parent 6ae252b892
commit 0d57213d3f

View File

@@ -13,6 +13,7 @@ import (
"sync"
"time"
"github.com/asim/go-micro/v3/cmd"
"github.com/asim/go-micro/v3/logger"
"github.com/asim/go-micro/v3/registry"
hash "github.com/mitchellh/hashstructure"
@@ -34,6 +35,10 @@ type etcdRegistry struct {
leases map[string]clientv3.LeaseID
}
func init() {
cmd.DefaultRegistries["etcd"] = NewRegistry
}
func NewRegistry(opts ...registry.Option) registry.Registry {
e := &etcdRegistry{
options: registry.Options{},