func newEtcdSubnetRegistry(endpoint, prefix string) subnetRegistry { return &etcdSubnetRegistry{ cli: etcd.NewClient([]string{endpoint}), endpoint: endpoint, prefix: prefix, } }
func newEtcdClient(c *EtcdConfig) (*etcd.Client, error) { if c.Keyfile != "" || c.Certfile != "" || c.CAFile != "" { return etcd.NewTLSClient(c.Endpoints, c.Certfile, c.Keyfile, c.CAFile) } else { return etcd.NewClient(c.Endpoints), nil } }
func (esr *etcdSubnetRegistry) resetClient() { esr.mux.Lock() defer esr.mux.Unlock() esr.cli = etcd.NewClient([]string{esr.endpoint}) }