A feature supported by some other Zookeeper clients, including the canonical
JVM one, is chroot support. This allows you to create (or move) a connection
that's relative to some fixed path prefix, for example "/apps/myapp", Chrooting
is discussed in the Zookeeper admin guide here:
https://zookeeper.apache.org/doc/r3.2.2/zookeeperProgrammers.html#ch_zkSessions
Here's the chroot interface for the canonical Java client:
https://zookeeper.apache.org/doc/r3.3.3/api/org/apache/zookeeper/ZooKeeper.html#ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher)
What do you think about chroot support in this client?
It would be tricky to support something like this against the current interface
of the Go client because we expect a []string of server addrs, instead of the
single connection string expected by the Java client. But perhaps we could
figure something out. An alternative would be a Chroot(path string) *Conn
method on *Conn that returned a new connection chrooted to the given
path.
If you're interested in supporting chrooting, I'd consider trying to write a
patch for it.
(BTW, thanks for writing and sharing this code!)