As suggested by John, I used this configuration:
<configuration>
<configSections>
<sectionGroup name="couchbase">
<section name="bucket-1" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
...
<section name="bucket-N" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
</sectionGroup>
</configSections>
...
<couchbase>
<bucket-1>
<servers bucket="bucket-1" bucketPassword="pass">
<add uri="http://10.0.0.1:8091/pools/default"/>
<add uri="http://10.0.0.2:8091/pools/default"/>
</servers>
</bucket-1>
</couchbase>
...
</configuration>
Then in the application code you can get the bucket client:
var client = new CouchbaseClient((CouchbaseClientSection)ConfigurationManager.GetSection("couchbase/bucket-1"));
It would be nice if the developers of the .Net couchbase library implement such a configuration.
source
share