export default domain

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2022-01-27 09:41:55 +03:00
parent 039f2eadc6
commit 8a4ed24b38

14
etcd.go
View File

@ -23,13 +23,11 @@ import (
) )
const ( const (
prefix = "/micro/register/" Defaultprefix = "/micro/register/"
defaultDomain = "micro" DefaultDomain = "micro"
) )
var ( var _ register.Register = &etcdRegister{}
_ register.Register = &etcdRegister{}
)
type etcdRegister struct { type etcdRegister struct {
client *clientv3.Client client *clientv3.Client
@ -41,8 +39,10 @@ type etcdRegister struct {
leases map[string]leases leases map[string]leases
} }
type reg map[string]uint64 type (
type leases map[string]clientv3.LeaseID reg map[string]uint64
leases map[string]clientv3.LeaseID
)
// NewRegister returns an initialized etcd register // NewRegister returns an initialized etcd register
func NewRegister(opts ...register.Option) *etcdRegister { func NewRegister(opts ...register.Option) *etcdRegister {