public EtcdClientUtils()

in client/Apache.ShenYu.Client/Utils/Etcd/EtcdClientUtils.cs [42:59]


        public EtcdClientUtils(EtcdOptions options)
        {
            //cluster:like "https://localhost:23790,https://localhost:23791,https://localhost:23792"
            this._client = new EtcdClient(options.Address);
            //auth
            if (!string.IsNullOrEmpty(options.UserName) && !string.IsNullOrEmpty(options.Password))
            {
                var authRes = this._client.Authenticate(new Etcdserverpb.AuthenticateRequest()
                {
                    Name = options.UserName,
                    Password = options.Password,
                });
                _authToken = authRes.Token;
                _authNeed = true;
                _metadata = _authNeed ? new Grpc.Core.Metadata() { new Grpc.Core.Metadata.Entry("token", _authToken) } : null;
            }
            InitLease(options);
        }