Explorar o código

add DeleteWithPrefix

zwde %!s(int64=7) %!d(string=hai) anos
pai
achega
46d023e427
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      client.go

+ 6 - 0
client.go

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