diff --git a/Consul.Test/ConnectTest.cs b/Consul.Test/ConnectTest.cs new file mode 100644 index 00000000..4c447bc7 --- /dev/null +++ b/Consul.Test/ConnectTest.cs @@ -0,0 +1,30 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2020 G-Research Limited +// +// Licensed under the Apache License, Version 2.0 (the "License"), +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Consul.Test +{ + public class ConnectTest: BaseFixture + { + } +} diff --git a/Consul/Client.cs b/Consul/Client.cs index 891271ec..2e572280 100644 --- a/Consul/Client.cs +++ b/Consul/Client.cs @@ -476,6 +476,7 @@ private void InitializeEndpoints() _authMethod = new Lazy(() => new AuthMethod(this)); _namespaces = new Lazy(() => new Namespaces(this)); _discoveryChain = new Lazy(() => new DiscoveryChain(this)); + _connect = new Lazy(() => new Connect(this)); } #region IDisposable Support diff --git a/Consul/Connect.cs b/Consul/Connect.cs new file mode 100644 index 00000000..b55f8bfa --- /dev/null +++ b/Consul/Connect.cs @@ -0,0 +1,45 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2020 G-Research Limited +// +// Licensed under the Apache License, Version 2.0 (the "License"), +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Text; +using Consul.Interfaces; + +namespace Consul +{ + public class Connect : IConnectEndpoint + { + private readonly ConsulClient _client; + + internal Connect(ConsulClient c) + { + _client = c; + } + } + + public partial class ConsulClient : IConsulClient + { + private Lazy _connect; + + /// + /// Connect returns a handle to the Connect endpoints + /// + public IConnectEndpoint Connect => _connect.Value; + } +} diff --git a/Consul/Interfaces/IConnectEndpoint.cs b/Consul/Interfaces/IConnectEndpoint.cs new file mode 100644 index 00000000..82211ae2 --- /dev/null +++ b/Consul/Interfaces/IConnectEndpoint.cs @@ -0,0 +1,28 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2020 G-Research Limited +// +// Licensed under the Apache License, Version 2.0 (the "License"), +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Consul.Interfaces +{ + public interface IConnectEndpoint + { + } +}