@@ -85,7 +85,7 @@ public struct BITCOUNT: ValkeyCommand {
85
85
public var key : ValkeyKey
86
86
public var range : Range ?
87
87
88
- @inlinable public init ( key: ValkeyKey , range: Range ? = nil ) {
88
+ @inlinable public init ( _ key: ValkeyKey , range: Range ? = nil ) {
89
89
self . key = key
90
90
self . range = range
91
91
}
@@ -248,17 +248,17 @@ public struct BITFIELD: ValkeyCommand {
248
248
public typealias Response = RESPToken . Array
249
249
250
250
public var key : ValkeyKey
251
- public var operation : [ Operation ]
251
+ public var operations : [ Operation ]
252
252
253
- @inlinable public init ( key: ValkeyKey , operation : [ Operation ] = [ ] ) {
253
+ @inlinable public init ( _ key: ValkeyKey , operations : [ Operation ] = [ ] ) {
254
254
self . key = key
255
- self . operation = operation
255
+ self . operations = operations
256
256
}
257
257
258
258
public var keysAffected : CollectionOfOne < ValkeyKey > { . init( key) }
259
259
260
260
@inlinable public func encode( into commandEncoder: inout ValkeyCommandEncoder ) {
261
- commandEncoder. encodeArray ( " BITFIELD " , key, operation )
261
+ commandEncoder. encodeArray ( " BITFIELD " , key, operations )
262
262
}
263
263
}
264
264
@@ -288,19 +288,19 @@ public struct BITFIELDRO: ValkeyCommand {
288
288
public typealias Response = [ Int ]
289
289
290
290
public var key : ValkeyKey
291
- public var getBlock : [ GetBlock ]
291
+ public var getBlocks : [ GetBlock ]
292
292
293
- @inlinable public init ( key: ValkeyKey , getBlock : [ GetBlock ] = [ ] ) {
293
+ @inlinable public init ( _ key: ValkeyKey , getBlocks : [ GetBlock ] = [ ] ) {
294
294
self . key = key
295
- self . getBlock = getBlock
295
+ self . getBlocks = getBlocks
296
296
}
297
297
298
298
public var keysAffected : CollectionOfOne < ValkeyKey > { . init( key) }
299
299
300
300
public var isReadOnly : Bool { true }
301
301
302
302
@inlinable public func encode( into commandEncoder: inout ValkeyCommandEncoder ) {
303
- commandEncoder. encodeArray ( " BITFIELD_RO " , key, RESPWithToken ( " GET " , getBlock ) )
303
+ commandEncoder. encodeArray ( " BITFIELD_RO " , key, RESPWithToken ( " GET " , getBlocks ) )
304
304
}
305
305
}
306
306
@@ -330,18 +330,18 @@ public struct BITOP: ValkeyCommand {
330
330
331
331
public var operation : Operation
332
332
public var destkey : ValkeyKey
333
- public var key : [ ValkeyKey ]
333
+ public var keys : [ ValkeyKey ]
334
334
335
- @inlinable public init ( operation: Operation , destkey: ValkeyKey , key : [ ValkeyKey ] ) {
335
+ @inlinable public init ( operation: Operation , destkey: ValkeyKey , keys : [ ValkeyKey ] ) {
336
336
self . operation = operation
337
337
self . destkey = destkey
338
- self . key = key
338
+ self . keys = keys
339
339
}
340
340
341
- public var keysAffected : [ ValkeyKey ] { key + [ destkey] }
341
+ public var keysAffected : [ ValkeyKey ] { keys + [ destkey] }
342
342
343
343
@inlinable public func encode( into commandEncoder: inout ValkeyCommandEncoder ) {
344
- commandEncoder. encodeArray ( " BITOP " , operation, destkey, key )
344
+ commandEncoder. encodeArray ( " BITOP " , operation, destkey, keys )
345
345
}
346
346
}
347
347
@@ -409,7 +409,7 @@ public struct BITPOS: ValkeyCommand {
409
409
public var bit : Int
410
410
public var range : Range ?
411
411
412
- @inlinable public init ( key: ValkeyKey , bit: Int , range: Range ? = nil ) {
412
+ @inlinable public init ( _ key: ValkeyKey , bit: Int , range: Range ? = nil ) {
413
413
self . key = key
414
414
self . bit = bit
415
415
self . range = range
@@ -432,7 +432,7 @@ public struct GETBIT: ValkeyCommand {
432
432
public var key : ValkeyKey
433
433
public var offset : Int
434
434
435
- @inlinable public init ( key: ValkeyKey , offset: Int ) {
435
+ @inlinable public init ( _ key: ValkeyKey , offset: Int ) {
436
436
self . key = key
437
437
self . offset = offset
438
438
}
@@ -455,7 +455,7 @@ public struct SETBIT: ValkeyCommand {
455
455
public var offset : Int
456
456
public var value : Int
457
457
458
- @inlinable public init ( key: ValkeyKey , offset: Int , value: Int ) {
458
+ @inlinable public init ( _ key: ValkeyKey , offset: Int , value: Int ) {
459
459
self . key = key
460
460
self . offset = offset
461
461
self . value = value
@@ -479,8 +479,8 @@ extension ValkeyConnectionProtocol {
479
479
/// - Complexity: O(N)
480
480
/// - Response: [Integer]: The number of bits set to 1.
481
481
@inlinable
482
- public func bitcount( key: ValkeyKey , range: BITCOUNT . Range ? = nil ) async throws -> Int {
483
- try await send ( command: BITCOUNT ( key: key , range: range) )
482
+ public func bitcount( _ key: ValkeyKey , range: BITCOUNT . Range ? = nil ) async throws -> Int {
483
+ try await send ( command: BITCOUNT ( key, range: range) )
484
484
}
485
485
486
486
/// Performs arbitrary bitfield integer operations on strings.
@@ -492,8 +492,8 @@ extension ValkeyConnectionProtocol {
492
492
/// * [Array]: The result of the subcommand at the same position
493
493
/// * [Array]: In case OVERFLOW FAIL was given and overflows or underflows detected
494
494
@inlinable
495
- public func bitfield( key: ValkeyKey , operation : [ BITFIELD . Operation ] = [ ] ) async throws -> RESPToken . Array {
496
- try await send ( command: BITFIELD ( key: key , operation : operation ) )
495
+ public func bitfield( _ key: ValkeyKey , operations : [ BITFIELD . Operation ] = [ ] ) async throws -> RESPToken . Array {
496
+ try await send ( command: BITFIELD ( key, operations : operations ) )
497
497
}
498
498
499
499
/// Performs arbitrary read-only bitfield integer operations on strings.
@@ -503,8 +503,8 @@ extension ValkeyConnectionProtocol {
503
503
/// - Complexity: O(1) for each subcommand specified
504
504
/// - Response: [Array]: The result of the subcommand at the same position
505
505
@inlinable
506
- public func bitfieldRo( key: ValkeyKey , getBlock : [ BITFIELDRO . GetBlock ] = [ ] ) async throws -> [ Int ] {
507
- try await send ( command: BITFIELDRO ( key: key , getBlock : getBlock ) )
506
+ public func bitfieldRo( _ key: ValkeyKey , getBlocks : [ BITFIELDRO . GetBlock ] = [ ] ) async throws -> [ Int ] {
507
+ try await send ( command: BITFIELDRO ( key, getBlocks : getBlocks ) )
508
508
}
509
509
510
510
/// Performs bitwise operations on multiple strings, and stores the result.
@@ -514,8 +514,8 @@ extension ValkeyConnectionProtocol {
514
514
/// - Complexity: O(N)
515
515
/// - Response: [Integer]: The size of the string stored in the destination key, that is equal to the size of the longest input string.
516
516
@inlinable
517
- public func bitop( operation: BITOP . Operation , destkey: ValkeyKey , key : [ ValkeyKey ] ) async throws -> Int {
518
- try await send ( command: BITOP ( operation: operation, destkey: destkey, key : key ) )
517
+ public func bitop( operation: BITOP . Operation , destkey: ValkeyKey , keys : [ ValkeyKey ] ) async throws -> Int {
518
+ try await send ( command: BITOP ( operation: operation, destkey: destkey, keys : keys ) )
519
519
}
520
520
521
521
/// Finds the first set (1) or clear (0) bit in a string.
@@ -529,8 +529,8 @@ extension ValkeyConnectionProtocol {
529
529
/// * [Integer]: The position of the first bit set to 1 or 0 according to the request.
530
530
/// * -1: In case the `bit` argument is 1 and the string is empty or composed of just zero bytes.
531
531
@inlinable
532
- public func bitpos( key: ValkeyKey , bit: Int , range: BITPOS . Range ? = nil ) async throws -> Int {
533
- try await send ( command: BITPOS ( key: key , bit: bit, range: range) )
532
+ public func bitpos( _ key: ValkeyKey , bit: Int , range: BITPOS . Range ? = nil ) async throws -> Int {
533
+ try await send ( command: BITPOS ( key, bit: bit, range: range) )
534
534
}
535
535
536
536
/// Returns a bit value by offset.
@@ -540,8 +540,8 @@ extension ValkeyConnectionProtocol {
540
540
/// - Complexity: O(1)
541
541
/// - Response: The bit value stored at offset.
542
542
@inlinable
543
- public func getbit( key: ValkeyKey , offset: Int ) async throws -> Int {
544
- try await send ( command: GETBIT ( key: key , offset: offset) )
543
+ public func getbit( _ key: ValkeyKey , offset: Int ) async throws -> Int {
544
+ try await send ( command: GETBIT ( key, offset: offset) )
545
545
}
546
546
547
547
/// Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist.
@@ -551,8 +551,8 @@ extension ValkeyConnectionProtocol {
551
551
/// - Complexity: O(1)
552
552
/// - Response: The original bit value stored at offset.
553
553
@inlinable
554
- public func setbit( key: ValkeyKey , offset: Int , value: Int ) async throws -> Int {
555
- try await send ( command: SETBIT ( key: key , offset: offset, value: value) )
554
+ public func setbit( _ key: ValkeyKey , offset: Int , value: Int ) async throws -> Int {
555
+ try await send ( command: SETBIT ( key, offset: offset, value: value) )
556
556
}
557
557
558
558
}
0 commit comments