Add etcd client impl (#84)

* add etcd sdk impl

* check
diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml
index 22cdbd9..64d6dff 100644
--- a/eventmesh-dashboard-core/pom.xml
+++ b/eventmesh-dashboard-core/pom.xml
@@ -58,6 +58,11 @@
             <artifactId>nacos-client</artifactId>
             <version>2.2.4</version>
         </dependency>
+        <dependency>
+            <groupId>io.etcd</groupId>
+            <artifactId>jetcd-core</artifactId>
+            <version>0.3.0</version>
+        </dependency>
 
         <!-- Event Store -->
         <dependency>
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java
index 43822e3..a203ff3 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java
@@ -18,6 +18,7 @@
 package org.apache.eventmesh.dashboard.core.function.SDK;
 
 import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig;
+import org.apache.eventmesh.dashboard.core.function.SDK.operation.EtcdSDKOperation;
 import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosConfigSDKOperation;
 import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosNamingSDKOperation;
 import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosSDKOperation;
@@ -70,6 +71,8 @@
         clientCreateOperationMap.put(SDKTypeEnum.META_NACOS_CONFIG, new NacosConfigSDKOperation());
         clientCreateOperationMap.put(SDKTypeEnum.META_NACOS_NAMING, new NacosNamingSDKOperation());
 
+        clientCreateOperationMap.put(SDKTypeEnum.META_ETCD, new EtcdSDKOperation());
+
     }
 
     private SDKManager() {
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java
index d01efa1..c6524c8 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java
@@ -34,5 +34,5 @@
 
     META_NACOS_NAMING,
 
-
+    META_ETCD,
 }
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateEtcdConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateEtcdConfig.java
new file mode 100644
index 0000000..1168a65
--- /dev/null
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateEtcdConfig.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package org.apache.eventmesh.dashboard.core.function.SDK.config;
+
+import lombok.Data;
+
+@Data
+public class CreateEtcdConfig implements CreateSDKConfig {
+
+    private String etcdServerAddress;
+
+    @Override
+    public String getUniqueKey() {
+        return etcdServerAddress;
+    }
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java
index 3f483c1..b630a38 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java
+++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java
@@ -18,18 +18,41 @@
 package org.apache.eventmesh.dashboard.core.function.SDK.operation;
 
 import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateEtcdConfig;
 import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig;
 
 import java.util.AbstractMap.SimpleEntry;
 
-public class EtcdSDKOperation extends AbstractSDKOperation {
+import io.etcd.jetcd.Client;
+import io.etcd.jetcd.KV;
+import io.etcd.jetcd.common.exception.EtcdException;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class EtcdSDKOperation extends AbstractSDKOperation<KV> {
+
     @Override
-    public SimpleEntry createClient(CreateSDKConfig clientConfig) {
-        return null;
+    public SimpleEntry<String, KV> createClient(CreateSDKConfig clientConfig) {
+        final CreateEtcdConfig etcdConfig = (CreateEtcdConfig) clientConfig;
+        KV kvClient = null;
+        try {
+            final Client client = Client.builder()
+                .endpoints(getSplitEndpoints(etcdConfig))
+                .build();
+            kvClient = client.getKVClient();
+        } catch (EtcdException e) {
+            log.error("create etcd client failed", e);
+        }
+        return new SimpleEntry<>(clientConfig.getUniqueKey(), kvClient);
+    }
+
+    private static String[] getSplitEndpoints(CreateEtcdConfig etcdConfig) {
+        return etcdConfig.getEtcdServerAddress().split(",");
     }
 
     @Override
     public void close(Object client) {
-
+        castClient(client).close();
     }
 }
diff --git a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKCreateOperationTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKCreateOperationTest.java
new file mode 100644
index 0000000..a4d8f4b
--- /dev/null
+++ b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKCreateOperationTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package org.apache.eventmesh.dashboard.core.function.SDK.operation;
+
+import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateEtcdConfig;
+
+import java.nio.charset.StandardCharsets;
+import java.util.AbstractMap.SimpleEntry;
+import java.util.List;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import io.etcd.jetcd.ByteSequence;
+import io.etcd.jetcd.KV;
+import io.etcd.jetcd.KeyValue;
+import io.etcd.jetcd.kv.GetResponse;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class EtcdSDKCreateOperationTest {
+
+    private final EtcdSDKOperation etcdSDKOperation = new EtcdSDKOperation();
+
+    private static final String key = "/test/foo";
+
+    private static final String value = "test";
+
+    private static final String url = "http://127.0.0.1:2379";
+
+    @Test
+    void testCreateClient() {
+        final CreateEtcdConfig etcdConfig = new CreateEtcdConfig();
+        etcdConfig.setEtcdServerAddress(url);
+        try {
+            final SimpleEntry<String, KV> simpleEntry = etcdSDKOperation.createClient(etcdConfig);
+            Assertions.assertEquals(url, simpleEntry.getKey());
+            simpleEntry.getValue().put(bytesOf(key), bytesOf(value));
+            final GetResponse response = simpleEntry.getValue().get(bytesOf(key)).get();
+            final List<KeyValue> keyValues = response.getKvs();
+            log.info("get key = {} , value = {} from etcd success",
+                keyValues.get(0).getKey().toString(StandardCharsets.UTF_8),
+                keyValues.get(0).getValue().toString(StandardCharsets.UTF_8));
+        } catch (Exception e) {
+            log.error("create etcd client failed", e);
+        }
+    }
+
+    private static ByteSequence bytesOf(String val) {
+        return ByteSequence.from(val, StandardCharsets.UTF_8);
+    }
+}