in client/Apache.ShenYu.Client/Registers/ShenyuEtcdRegister.cs [40:61]
public override async Task Init(ShenyuOptions shenyuOptions)
{
if (string.IsNullOrEmpty(shenyuOptions.Register.ServerList))
{
throw new System.ArgumentException("serverList can not be null.");
}
this._shenyuOptions = shenyuOptions;
var props = shenyuOptions.Register.Props;
long timeout = Convert.ToInt64(props.GetValueOrDefault(Constants.RegisterConstants.EtcdTimeout, "3000"));
long ttl = Convert.ToInt64(props.GetValueOrDefault(Constants.RegisterConstants.EtcdTTL, "5"));
props.TryGetValue(Constants.RegisterConstants.UserName, out string userName);
props.TryGetValue(Constants.RegisterConstants.Password, out string password);
_etcdClient = new EtcdClientUtils(new EtcdOptions()
{
Address = shenyuOptions.Register.ServerList,
UserName = userName,
Password = password,
TTL = ttl,
Timeout = timeout,
});
await Task.CompletedTask;
}