Ejemplo n.º 1
0
 /// <summary>
 /// Sets the key value in etcd
 /// </summary>
 /// <param name="key">Key for which value need to be set</param>
 /// <param name="val">Value corresponding the key</param>
 /// <returns></returns>
 public void Put(string key, string val)
 {
     var putResponse = _kvClient.Put(new PutRequest
     {
         Key   = ByteString.CopyFromUtf8(key),
         Value = ByteString.CopyFromUtf8(val)
     }, _headers);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the key value in etcd
 /// </summary>
 /// <param name="key">Key for which value need to be set</param>
 /// <param name="val">Value corresponding the key</param>
 /// <returns></returns>
 public PutResponse Put(string key, string val)
 {
     try
     {
         return(_kvClient.Put(new PutRequest
         {
             Key = ByteString.CopyFromUtf8(key),
             Value = ByteString.CopyFromUtf8(val)
         }, _headers));
     }
     catch (Grpc.Core.RpcException)
     {
         ResetConnection();
         throw;
     }
     catch
     {
         throw;
     }
 }