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:
		| @@ -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{}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user