예제 #1
0
        public async Task <IReadOnlyList <string> > GetAllEnvironmentsAsync()
        {
            var data = await zooKeeperClient.GetChildrenAsync(new GetChildrenRequest(settings.ZooKeeperNodesPrefix)).ConfigureAwait(false);

            if (data.Status == ZooKeeperStatus.NodeNotFound)
            {
                return(new string[0]);
            }

            data.EnsureSuccess();
            return(data.ChildrenNames.Select(n => pathHelper.Unescape(n)).ToList());
        }
예제 #2
0
        public void Unescape_should_unescape_escaped(string segment)
        {
            var pathHelper = new ServiceDiscoveryPathHelper("", ZooKeeperPathEscaper.Instance);

            pathHelper.Unescape(pathHelper.Escape(segment)).Should().Be(segment);
        }