Explorar el Código

add DeleteWithPrefix

zwde hace 6 años
padre
commit
46d023e427
Se han modificado 1 ficheros con 6 adiciones y 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
+}