Exemple #1
0
        public void TestEtcdSimpleSetAndAdd()
        {
            if (!CheckEtcdRunning())
            {
                Assert.Ignore();
                return;
            }
            var respSet = etcd.Set("csharp-etcetera-test", "123");

            Assert.AreEqual(respSet.Node.Value, "123");
            var respGet = etcd.Get("csharp-etcetera-test");

            Assert.AreEqual(respGet.Node.Value, "123");
        }
Exemple #2
0
        public Task <EtcdResponse> SetAsync(string key, string value)
        {
            TaskCompletionSource <EtcdResponse> tcs = new TaskCompletionSource <EtcdResponse>();

            Task.Factory.StartNew(() =>
            {
                tcs.SetResult(_etcdClient.Set(key, value));
            });


            return(tcs.Task);
        }
Exemple #3
0
        public static void Configure(ServiceConfiguration config)
        {
            //ServiceEndpoint se = new ServiceEndpoint(new ContractDescription("IService1"), new BasicHttpBinding(), new EndpointAddress("http://localhost/testservice/service1.svc"));
            //se.Behaviors.Add(new MyEndpointBehavior());
            //config.AddServiceEndpoint(se);

            config.Description.Behaviors.Add(new ServiceMetadataBehavior {
                HttpGetEnabled = true
            });
            config.Description.Behaviors.Add(new ServiceDebugBehavior {
                IncludeExceptionDetailInFaults = true
            });

            var etcd = new EtcdClient(new Uri("http://localhost:4001/v2/keys/"));

            etcd.Set("local/EtcdPrototype.IService1/url", config.BaseAddresses.First().ToString());
//            etcd.Set("local/EtcdPrototype.IService1/binding",config.)
        }
Exemple #4
0
 public static void InsertSomeTestData()
 {
     _client.Set("/appconfig/internportalen/dbConnectionString", "db-01.bekk.no;Database=internportalen;user:foo;password:bar");
     _client.Set("/appconfig/internportalen/apikey", "some-secret-api-key");
 }
 public CanDeleteDirsWithStuff()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set(_key+"/bob", "hi");
     _deleteResponse = _etcdClient.DeleteDir(_key.ToString(), true);
 }
Exemple #6
0
 public CanDeleteKeys()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set(_key.ToString(), "wassup");
     _deleteResponse = _etcdClient.Delete(_key.ToString());
 }
Exemple #7
0
 public CanSetKeysWithTtl()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set(_key.ToString(), "wassup", _ttl);
     _now = DateTime.Now;
 }
Exemple #8
0
 public CanSetKeys()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set("dru", "wassup");
 }
Exemple #9
0
 public CanHandleExpiredKeys()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _etcdClient.Set(_key.ToString(), "wassup", _ttl);
 }
Exemple #10
0
 public CanGetKeys()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set(_key.ToString(), "wassup");
     _getResponse = _etcdClient.Get(_key.ToString());
 }
Exemple #11
0
 public KeysWithSlashes()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/"));
     _response = _etcdClient.Set("/folder1/bill", "wassup");
 }
Exemple #12
0
 public TrimUserSuppliedPath()
 {
     _etcdClient = new EtcdClient(new Uri("http://192.168.101.1:4001/v2/keys"));
     _response = _etcdClient.Set("dru", "wassup");
 }