Sfoglia il codice sorgente

add DeleteWithPrefix

zwde 6 anni fa
parent
commit
46d023e427
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      client.go

+ 6 - 0
client.go

@@ -63,3 +63,9 @@ func Delete(key string) error {
 
 
 	return err
 	return err
 }
 }
+
+func DeleteWithPrefix(key string) error {
+	_, err := client.Delete(context.TODO(), key, clientv3.WithPrefix())
+
+	return err
+}