forked from valkey-io/valkey-glide-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalkey_glide_cluster.stub.php
More file actions
1340 lines (1103 loc) · 44.1 KB
/
valkey_glide_cluster.stub.php
File metadata and controls
1340 lines (1103 loc) · 44.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @generate-function-entries
* @generate-legacy-arginfo
* @generate-class-entries
*/
/*
* --------------------------------------------------------------------
* The PHP License, version 3.01
* Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
* --------------------------------------------------------------------
*
* Redistribution and use in source and binary forms, with or without
* modification, is permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "PHP" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact group@php.net.
*
* 4. Products derived from this software may not be called "PHP", nor
* may "PHP" appear in their name, without prior written permission
* from group@php.net. You may indicate that your software works in
* conjunction with PHP by saying "Foo for PHP" instead of calling
* it "PHP Foo" or "phpfoo"
*
* 5. The PHP Group may publish revised and/or new versions of the
* license from time to time. Each version will be given a
* distinguishing version number.
* Once covered code has been published under a particular version
* of the license, you may always continue to use it under the terms
* of that version. You may also choose to use such covered code
* under the terms of any subsequent version of the license
* published by the PHP Group. No one other than the PHP Group has
* the right to modify the terms applicable to covered code created
* under this License.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes PHP software, freely available from
* <http://www.php.net/software/>".
*
* THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
* DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* --------------------------------------------------------------------
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the PHP Group.
*
* The PHP Group can be contacted via Email at group@php.net.
*
* For more information on the PHP Group and the PHP project,
* please see <http://www.php.net>.
*
* PHP includes the Zend Engine, freely available at
* <http://www.zend.com>.
*/
class ValkeyGlideCluster
{
/**
* Hash field condition constants
* @var string
*/
public const CONDITION_NX = "NX"; // Only if field doesn't exist
/**
* @var string
*/
public const CONDITION_XX = "XX"; // Only if field exists
/**
* Time unit constants for hash field expiration
* @var string
*/
public const TIME_UNIT_SECONDS = "EX"; // Expire in seconds
/**
* @var string
*/
public const TIME_UNIT_MILLISECONDS = "PX"; // Expire in milliseconds
/**
* @var string
*/
public const TIME_UNIT_TIMESTAMP_SECONDS = "EXAT"; // Expire at timestamp (seconds)
/**
* @var string
*/
public const TIME_UNIT_TIMESTAMP_MILLISECONDS = "PXAT"; // Expire at timestamp (milliseconds)
/**
* IAM Authentication Constants
*/
/**
* @var string
* IAM service type for AWS ElastiCache
*/
public const IAM_SERVICE_ELASTICACHE = 'Elasticache';
/**
* @var string
* IAM service type for AWS MemoryDB
*/
public const IAM_SERVICE_MEMORYDB = 'MemoryDB';
/**
* @var string
* IAM config key for cluster name
*/
public const IAM_CONFIG_CLUSTER_NAME = 'clusterName';
/**
* @var string
* IAM config key for AWS region
*/
public const IAM_CONFIG_REGION = 'region';
/**
* @var string
* IAM config key for service type
*/
public const IAM_CONFIG_SERVICE = 'service';
/**
* @var string
* IAM config key for token refresh interval in seconds
*/
public const IAM_CONFIG_REFRESH_INTERVAL = 'refreshIntervalSeconds';
/**
* @var string
* Advanced config key for refresh topology from initial nodes option
*/
public const ADVANCED_CONFIG_REFRESH_TOPOLOGY_FROM_INITIAL_NODES = 'refresh_topology_from_initial_nodes';
/**
* @var int
* Enables the periodic checks with the default configurations.
*/
public const PERIODIC_CHECK_ENABLED_DEFAULT_CONFIGS = 0;
/**
* @var int
* Disables the periodic checks.
*/
public const PERIODIC_CHECK_DISABLED = 1;
/**
* Create a new ValkeyGlideCluster instance with the provided configuration.
*
* @param array $addresses Array of server addresses [['host' => '127.0.0.1', 'port' => 7001], ...].
* @param bool $use_tls Whether to use TLS encryption.
* @param array|null $credentials Authentication credentials. Can be either:
* - Password auth: ['password' => 'xxx', 'username' => 'yyy']
* - IAM auth: ['username' => 'yyy', 'iamConfig' => [
* ValkeyGlide::IAM_CONFIG_CLUSTER_NAME => 'my-cluster',
* ValkeyGlide::IAM_CONFIG_REGION => 'us-east-1',
* ValkeyGlide::IAM_CONFIG_SERVICE => ValkeyGlide::IAM_SERVICE_ELASTICACHE,
* ValkeyGlide::IAM_CONFIG_REFRESH_INTERVAL => 300 // optional, defaults to 300
* ]]
* Note: username is REQUIRED for IAM authentication.
* @param int $read_from Read strategy for the client.
* @param int|null $request_timeout Request timeout in milliseconds.
* @param array|null $reconnect_strategy Reconnection strategy ['num_of_retries' => 3, 'factor' => 2,
* 'exponent_base' => 10, 'jitter_percent' => 15].
* @param string|null $client_name Client name identifier.
* @param int|null $periodic_checks Periodic checks configuration.
* @param string|null $client_az Client availability zone.
* @param array|null $advanced_config Advanced configuration options:
* - 'connection_timeout' => 5000 (milliseconds)
* - 'tls_config' => ['use_insecure_tls' => false]
* - 'refresh_topology_from_initial_nodes' => false (default: false)
* When true, topology updates use only initial nodes instead of internal cluster view.
* - 'otel' => OpenTelemetryConfig::builder()
* ->traces(TracesConfig::builder()
* ->endpoint('grpc://localhost:4317')
* ->samplePercentage(1)
* ->build())
* ->metrics(MetricsConfig::builder()
* ->endpoint('grpc://localhost:4317')
* ->build())
* ->flushIntervalMs(5000)
* ->build()
* @param bool|null $lazy_connect Whether to use lazy connection.
* @param int|null $database_id Index of the logical database to connect to. Must be non-negative
* and within the range supported by the server configuration.
* For cluster mode, requires Valkey 9.0+ with cluster-databases > 1.
* If not specified, defaults to database 0.
*/
public function __construct(
array $addresses,
bool $use_tls = false,
?array $credentials = null,
int $read_from = ValkeyGlide::READ_FROM_PREFER_REPLICA,
?int $request_timeout = null,
?array $reconnect_strategy = null,
?string $client_name = null,
?int $periodic_checks = ValkeyGlideCluster::PERIODIC_CHECK_ENABLED_DEFAULT_CONFIGS,
?string $client_az = null,
?array $advanced_config = null,
?bool $lazy_connect = null,
?int $database_id = null
) {
}
/**
* @see ValkeyGlide::append()
*/
public function append(string $key, mixed $value): ValkeyGlideCluster|bool|int;
/**
* @see ValkeyGlide::bitcount
*/
public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): ValkeyGlideCluster|bool|int;
/**
* @see ValkeyGlide::bitop
*/
public function bitop(string $operation, string $deskey, string $srckey, string ...$otherkeys): ValkeyGlideCluster|bool|int;
/**
* Return the position of the first bit set to 0 or 1 in a string.
*
* @see https://https://valkey.io/commands/bitpos/
*
* @param string $key The key to check (must be a string)
* @param bool $bit Whether to look for an unset (0) or set (1) bit.
* @param int $start Where in the string to start looking.
* @param int $end Where in the string to stop looking.
* @param bool $bybit If true, ValkeyGlide will treat $start and $end as BIT values and not bytes, so if start
* was 0 and end was 2, ValkeyGlide would only search the first two bits.
*/
public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): ValkeyGlideCluster|int|false;
/**
* See ValkeyGlide::blpop()
*/
public function blPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): ValkeyGlideCluster|array|null|false;
/**
* See ValkeyGlide::brpop()
*/
public function brPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): ValkeyGlideCluster|array|null|false;
/**
* Move an element from one list into another.
*
* @see ValkeyGlide::lmove
*/
public function lMove(string $src, string $dst, string $wherefrom, string $whereto): ValkeyGlide|string|false;
/**
* Move an element from one list to another, blocking up to a timeout until an element is available.
*
* @see ValkeyGlide::blmove
*
*/
public function blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout): ValkeyGlide|string|false;
/**
* @see ValkeyGlide::bzpopmax
*/
public function bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array;
/**
* @see ValkeyGlide::bzpopmin
*/
public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array;
/**
* @see ValkeyGlide::bzmpop
*/
public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): ValkeyGlideCluster|array|null|false;
/**
* @see ValkeyGlide::zmpop
*/
public function zmpop(array $keys, string $from, int $count = 1): ValkeyGlideCluster|array|null|false;
/**
* @see ValkeyGlide::blmpop()
*/
public function blmpop(float $timeout, array $keys, string $from, int $count = 1): ValkeyGlideCluster|array|null|false;
/**
* @see ValkeyGlide::lmpop()
*/
public function lmpop(array $keys, string $from, int $count = 1): ValkeyGlideCluster|array|null|false;
/**
* @see ValkeyGlide::client
*/
public function client(mixed $route, string $subcommand, ?string $arg = null): array|string|bool;
/**
* @see ValkeyGlide::close
*/
public function close(): bool;
/**
* @see ValkeyGlide::updateConnectionPassword
*/
public function updateConnectionPassword(string $password, bool $immediateAuth = false): string;
/**
* @see ValkeyGlide::clearConnectionPassword
*/
public function clearConnectionPassword(bool $immediateAuth = false): string;
/**
* @see ValkeyGlide::config()
*/
//TODO public function config(mixed $route, string $subcommand, mixed ...$extra_args): mixed;
/**
* @param mixed $route The routing configuration that determines which node(s) to send the
* command to. Can be:
* - string "randomNode" to route to a random node
* - string "allPrimaries" to route to all primary nodes
* - string "allNodes" to route to all nodes (primaries and replicas)
* - string containing a key name for slot-based routing
* - array ['type' => 'primarySlotKey', 'key' => 'keyName'] for slot key routing
* - array ['type' => 'routeByAddress', 'host' => 'hostname', 'port' => port]
* for specific node routing
* @see ValkeyGlide::dbsize()
*/
public function dbSize(mixed $route): ValkeyGlideCluster|int;
/**
* @see ValkeyGlide::select
*/
public function select(int $db): ValkeyGlideCluster|bool;
/**
* Move a key to a different database on the same valkey instance.
* This command is supported in cluster mode starting with Valkey 9.0.
*
* @param string $key The key to move
* @param int $index The database index to move the key to
* @return ValkeyGlideCluster|bool True if the key was moved
*/
public function move(string $key, int $index): ValkeyGlideCluster|bool;
/**
* @see https://valkey.io/commands/copy
*/
public function copy(string $src, string $dst, ?array $options = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::decr()
*/
public function decr(string $key, int $by = 1): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::decrBy()
*/
public function decrBy(string $key, int $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::del()
*/
public function del(array|string $key, string ...$other_keys): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::discard
*/
public function discard(): bool;
/**
* @see ValkeyGlide::dump
*/
public function dump(string $key): ValkeyGlideCluster|string|false;
/**
* @see ValkeyGlide::echo()
*/
public function echo(mixed $route, string $msg): ValkeyGlideCluster|string|false;
/**
* @see ValkeyGlide::eval
*/
/* TODO public function eval(string $script, array $args = [], int $num_keys = 0): mixed; */
/**
* @see ValkeyGlide::eval_ro
*/
/* TODOpublic function eval_ro(string $script, array $args = [], int $num_keys = 0): mixed; */
/**
* @see ValkeyGlide::evalsha
*/
/* TODO public function evalsha(string $script_sha, array $args = [], int $num_keys = 0): mixed;*/
/**
* @see ValkeyGlide::evalsha_ro
*/
/* TODOpublic function evalsha_ro(string $script_sha, array $args = [], int $num_keys = 0): mixed;*/
/**
* @see ValkeyGlide::exec()
*/
public function exec(): array|false;
/**
* @see ValkeyGlide::exists
*/
public function exists(mixed $key, mixed ...$other_keys): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::touch()
*/
public function touch(mixed $key, mixed ...$other_keys): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::expire
*/
public function expire(string $key, int $timeout, ?string $mode = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::expireat
*/
public function expireAt(string $key, int $timestamp, ?string $mode = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::expiretime()
*/
public function expiretime(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::pexpiretime()
*/
public function pexpiretime(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::flushall
*/
public function flushAll(mixed $route, bool $async = false): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::flushdb
*/
public function flushDB(mixed $route, bool $async = false): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::geoadd
*/
public function geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::geodist
*/
public function geodist(string $key, string $src, string $dest, ?string $unit = null): ValkeyGlideCluster|float|false;
/**
* @see ValkeyGlide::geohash
*/
public function geohash(string $key, string $member, string ...$other_members): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::geopos
*/
public function geopos(string $key, string $member, string ...$other_members): ValkeyGlideCluster|array|false;
/**
* @see https://valkey.io/commands/geosearch
*/
public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): ValkeyGlideCluster|array;
/**
* @see https://valkey.io/commands/geosearchstore
*/
public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): ValkeyGlideCluster|array|int|false;
/**
* @see ValkeyGlide::get
*/
public function get(string $key): mixed;
/**
* @see ValkeyGlide::getDel
*/
public function getDel(string $key): mixed;
/**
* @see ValkeyGlide::getEx
*/
public function getEx(string $key, array $options = []): ValkeyGlideCluster|string|false;
/**
* @see ValkeyGlide::getbit
*/
public function getBit(string $key, int $idx): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::getrange
*/
public function getRange(string $key, int $start, int $end): ValkeyGlideCluster|string|false;
/**
* @see ValkeyGlide::lcs
*/
public function lcs(string $key1, string $key2, ?array $options = null): ValkeyGlideCluster|string|array|int|false;
/**
* @see ValkeyGlide::getset
*/
public function getset(string $key, mixed $value): ValkeyGlideCluster|string|bool;
/**
* @see ValkeyGlide::hdel
*/
public function hDel(string $key, string $member, string ...$other_members): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hexists
*/
public function hExists(string $key, string $member): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::hget
*/
public function hGet(string $key, string $member): mixed;
/**
* @see ValkeyGlide::hgetall
*/
public function hGetAll(string $key): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hincrby
*/
public function hIncrBy(string $key, string $member, int $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hincrbyfloat
*/
public function hIncrByFloat(string $key, string $member, float $value): ValkeyGlideCluster|float|false;
/**
* @see ValkeyGlide::hkeys
*/
public function hKeys(string $key): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hlen
*/
public function hLen(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hmget
*/
public function hMget(string $key, array $keys): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hmset
*/
public function hMset(string $key, array $key_values): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::hscan
*/
public function hscan(string $key, null|string &$iterator, ?string $pattern = null, int $count = 0): array|bool;
/**
* @see https://valkey.io/commands/hrandfield
*/
public function hRandField(string $key, ?array $options = null): ValkeyGlideCluster|string|array;
/**
* @see ValkeyGlide::hset
*/
public function hSet(string $key, string $member, mixed $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hsetnx
*/
public function hSetNx(string $key, string $member, mixed $value): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::hstrlen
*/
public function hStrLen(string $key, string $field): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hvals
*/
public function hVals(string $key): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hSetEx
*/
public function hSetEx(string $key, int $seconds, ?string $mode, string $field, mixed $value, mixed ...$fields_and_vals): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hPSetEx
*/
public function hPSetEx(string $key, int $milliseconds, ?string $mode, string $field, mixed $value, mixed ...$fields_and_vals): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::hGetEx
*/
public function hGetEx(string $key, array $fields, ?array $options = null): mixed;
/**
* @see ValkeyGlide::hExpire
*/
public function hExpire(string $key, int $seconds, ?string $mode, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hPExpireAt
*/
public function hPExpireAt(string $key, int $unix_timestamp_ms, ?string $mode, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hPExpire
*/
public function hPExpire(string $key, int $milliseconds, ?string $mode, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hExpireAt
*/
public function hExpireAt(string $key, int $unix_timestamp, ?string $mode, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hTtl
*/
public function hTtl(string $key, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hPTtl
*/
public function hPTtl(string $key, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hExpireTime
*/
public function hExpireTime(string $key, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hPExpireTime
*/
public function hPExpireTime(string $key, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::hPersist
*/
public function hPersist(string $key, string $field, string ...$other_fields): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::incr
*/
public function incr(string $key, int $by = 1): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::incrby
*/
public function incrBy(string $key, int $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::incrbyfloat
*/
public function incrByFloat(string $key, float $value): ValkeyGlideCluster|float|false;
/**
* Retrieve information about the connected valkey-server. If no arguments are passed to
* this function, valkey will return every info field. Alternatively you may pass a specific
* section you want returned (e.g. 'server', or 'memory') to receive only information pertaining
* to that section.
*
* If connected to ValkeyGlide server >= 7.0.0 you may pass multiple optional sections.
*
* @see https://valkey.io/commands/info/
*
* @param mixed $route The routing configuration that determines which node(s) to send the
* command to. Can be:
* - string "randomNode" to route to a random node
* - string "allPrimaries" to route to all primary nodes
* - string "allNodes" to route to all nodes (primaries and replicas)
* - string containing a key name for slot-based routing
* - array ['type' => 'primarySlotKey', 'key' => 'keyName'] for slot key routing
* - array ['type' => 'routeByAddress', 'host' => 'hostname', 'port' => port]
* for specific node routing
* @param string $sections Optional section(s) you wish ValkeyGlide server to return.
*
* @return ValkeyGlideCluster|array|false
*/
public function info(mixed $route, string ...$sections): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::lindex
*/
public function lindex(string $key, int $index): mixed;
/**
* @see ValkeyGlide::linsert
*/
public function lInsert(string $key, string $pos, mixed $pivot, mixed $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::llen
*/
public function lLen(string $key): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::lpop
*/
public function lPop(string $key, int $count = 0): ValkeyGlideCluster|bool|string|array;
/**
* @see ValkeyGlide::lpos
*/
public function lPos(string $key, mixed $value, ?array $options = null): ValkeyGlide|null|bool|int|array;
/**
* @see ValkeyGlide::lpush
*/
public function lPush(string $key, mixed $value, mixed ...$other_values): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::lpushx
*/
public function lPushx(string $key, mixed $value): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::lrange
*/
public function lrange(string $key, int $start, int $end): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::lrem
*/
public function lrem(string $key, mixed $value, int $count = 0): ValkeyGlideCluster|int|bool;
/**
* @see ValkeyGlide::lset
*/
public function lSet(string $key, int $index, mixed $value): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::ltrim
*/
public function ltrim(string $key, int $start, int $end): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::mget
*/
public function mget(array $keys): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::mset
*/
public function mset(array $key_values): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::msetnx
*/
public function msetnx(array $key_values): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::multi
*/
public function multi(int $value = ValkeyGlide::MULTI): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::pipeline
*/
public function pipeline(): bool|ValkeyGlideCluster;
/**
* @see ValkeyGlide::object
*/
public function object(string $subcommand, string $key): ValkeyGlideCluster|int|string|false;
/**
* @see ValkeyGlide::persist
*/
public function persist(string $key): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::pexpire
*/
public function pexpire(string $key, int $timeout, ?string $mode = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::pexpireat
*/
public function pexpireAt(string $key, int $timestamp, ?string $mode = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::pfadd()
*/
public function pfadd(string $key, array $elements): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::pfcount()
*/
public function pfcount(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::pfmerge()
*/
public function pfmerge(string $key, array $keys): ValkeyGlideCluster|bool;
/**
* PING an instance in the valkey cluster.
*
* @see ValkeyGlide::ping()
*
* @param mixed $route The routing configuration that determines which node(s) to send the
* command to. Can be:
* - string "randomNode" to route to a random node
* - string "allPrimaries" to route to all primary nodes
* - string "allNodes" to route to all nodes (primaries and replicas)
* - string containing a key name for slot-based routing
* - array ['type' => 'primarySlotKey', 'key' => 'keyName'] for slot key routing
* - array ['type' => 'routeByAddress', 'host' => 'hostname', 'port' => port]
* for specific node routing
*
* @param string $message An optional message to send.
*
* @return mixed This method always returns `true` if no message was sent, and the message itself
* if one was.
*/
public function ping(mixed $route, ?string $message = null): mixed;
/**
* @see ValkeyGlide::psetex
*/
public function psetex(string $key, int $timeout, string $value): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::psubscribe
*/
/* TODO public function psubscribe(array $patterns, callable $callback): void; */
/**
* @see ValkeyGlide::pttl
*/
public function pttl(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::publish
*/
/* TODO public function publish(string $channel, string $message): ValkeyGlideCluster|bool|int;*/
/**
* @see ValkeyGlide::pubsub
*/
/* TODO public function pubsub(mixed $route, string ...$values): mixed;*/
/**
* @see ValkeyGlide::punsubscribe
*/
/* TODO public function punsubscribe(string $pattern, string ...$other_patterns): bool|array;*/
/**
* @see ValkeyGlide::randomkey
*/
public function randomKey(mixed $route): ValkeyGlideCluster|bool|string;
/**
* @see ValkeyGlide::rawcommand
*/
public function rawcommand(mixed $route, string $command, mixed ...$args): mixed;
/**
* @see ValkeyGlide::rename
*/
public function rename(string $key_src, string $key_dst): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::renamenx
*/
public function renameNx(string $key, string $newkey): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::restore
*/
public function restore(string $key, int $timeout, string $value, ?array $options = null): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::rpop()
*/
public function rPop(string $key, int $count = 0): ValkeyGlideCluster|bool|string|array;
/**
* @see ValkeyGlide::rpush
*/
public function rPush(string $key, mixed ...$elements): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::rpushx
*/
public function rPushx(string $key, string $value): ValkeyGlideCluster|bool|int;
/**
* @see ValkeyGlide::sadd()
*/
public function sAdd(string $key, mixed $value, mixed ...$other_values): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::scan
*/
public function scan(ClusterScanCursor $iterator, ?string $pattern = null, int $count = 0, ?string $type = null): bool|array;
/**
* @see ValkeyGlide::scard
*/
public function scard(string $key): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::script
*/
public function script(mixed $route, mixed ...$args): mixed;
/**
* @see ValkeyGlide::sdiff()
*/
public function sDiff(string $key, string ...$other_keys): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::sdiffstore()
*/
public function sDiffStore(string $dst, string $key, string ...$other_keys): ValkeyGlideCluster|int|false;
/**
* @see https://valkey.io/commands/set
*/
public function set(string $key, mixed $value, mixed $options = null): ValkeyGlideCluster|string|bool;
/**
* @see ValkeyGlide::setbit
*/
public function setBit(string $key, int $offset, bool $onoff): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::setex
*/
public function setex(string $key, int $expire, mixed $value): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::setnx
*/
public function setnx(string $key, mixed $value): ValkeyGlideCluster|bool;
/**
* @see ValkeyGlide::setrange
*/
public function setRange(string $key, int $offset, string $value): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::sinter()
*/
public function sInter(array|string $key, string ...$other_keys): ValkeyGlideCluster|array|false;
/**
* @see ValkeyGlide::sintercard
*/
public function sintercard(array $keys, int $limit = -1): ValkeyGlideCluster|int|false;
/**
* @see ValkeyGlide::sinterstore()
*/
public function sInterStore(array|string $key, string ...$other_keys): ValkeyGlideCluster|int|false;