Skip to content

Commit 3219803

Browse files
committed
fix final docs issues
1 parent 384ac21 commit 3219803

10 files changed

+41
-22
lines changed

Package.swift

+3
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@ let package = Package(
9393
),
9494
]
9595
)
96+
package.dependencies.append(
97+
.package(url: "https://github.com/swiftlang/swift-docc-plugin", "1.0.0"..<"1.4.0")
98+
)

Sources/RediStack/Cluster/RedisHashSlot.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension RedisHashSlot: CustomStringConvertible {
9393
}
9494

9595
extension RedisHashSlot {
96-
/// Creates a slot for a given `key`. A ``HashSlot`` is used to determine which shard to connect to.
96+
/// Creates a slot for a given `key`. A `HashSlot` is used to determine which shard to connect to.
9797
/// - Parameter key: The key used in a redis command
9898
public init(key: String) {
9999
// Banging is safe because the modulo ensures we are in range

Sources/RediStack/Commands/ListCommands.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ extension RedisClient {
545545
/// - Parameters:
546546
/// - source: The key of the list to pop from.
547547
/// - dest: The key of the list to push to.
548-
/// - type: The type to convert the value to.
548+
/// - valueType: Type of the value.
549549
/// - Returns: The element that was moved. This value is `nil` if the `RESPValue` conversion failed.
550550
@inlinable
551551
public func rpoplpush<Value: RESPValueConvertible>(
@@ -601,7 +601,7 @@ extension RedisClient {
601601
/// - source: The key of the list to pop from.
602602
/// - dest: The key of the list to push to.
603603
/// - timeout: The max time to wait for a value to use. `0` seconds means to wait indefinitely.
604-
/// - type: The type to convert the value to.
604+
/// - valueType: Type of the value.
605605
/// - Returns: The element popped from the source list and pushed to the destination.
606606
/// If the timeout was reached or `RESPValue` conversion failed, the returned value will be `nil`.
607607
@inlinable
@@ -765,6 +765,7 @@ extension RedisClient {
765765
///
766766
/// See [https://redis.io/commands/rpop](https://redis.io/commands/rpop)
767767
/// - Parameter key: The key of the list to pop from.
768+
/// - Parameter type: The type of the value.
768769
/// - Returns: The element that was popped from the list. If the list is empty or the `RESPValue` conversion fails, this value is `nil`.
769770
@inlinable
770771
public func rpop<Value: RESPValueConvertible>(from key: RedisKey, as type: Value.Type) -> EventLoopFuture<Value?> {
@@ -1058,6 +1059,7 @@ extension RedisClient {
10581059
/// - Parameters:
10591060
/// - keys: The keys of lists in Redis that should be popped from.
10601061
/// - timeout: The max time to wait for a value to use. `0`seconds means to wait indefinitely.
1062+
/// - valueType: Type of the value.
10611063
/// - Returns:
10621064
/// If timeout was reached or `RESPValue` conversion failed, `nil`.
10631065
///
@@ -1115,6 +1117,7 @@ extension RedisClient {
11151117
/// - Parameters:
11161118
/// - keys: The keys of lists in Redis that should be popped from.
11171119
/// - timeout: The max time to wait for a value to use. `0`seconds means to wait indefinitely.
1120+
/// - valueType: The type of the value.
11181121
/// - Returns:
11191122
/// If timeout was reached or `RESPValue` conversion failed, `nil`.
11201123
///

Sources/RediStack/Commands/SetCommands.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ extension RedisClient {
204204
/// See [https://redis.io/commands/srandmember](https://redis.io/commands/srandmember)
205205
/// - Parameters:
206206
/// - key: The key of the set.
207-
/// - type; The type to convert the values to.
207+
/// - type: The type to convert the values to.
208208
/// - count: The max number of elements to select from the set.
209209
/// - Returns: The elements randomly selected from the set. Elements that fail the `RESPValue` conversion will be `nil`.
210210
@inlinable
@@ -349,7 +349,7 @@ extension RedisClient {
349349
/// See [https://redis.io/commands/sdiffstore](https://redis.io/commands/sdiffstore)
350350
/// - Parameters:
351351
/// - destination: The key of the new set from the result.
352-
/// - sources: The list of source sets to calculate the difference of.
352+
/// - keys: The list of source sets to calculate the difference of.
353353
/// - Returns: The number of elements in the difference result.
354354
public func sdiffstore(as destination: RedisKey, sources keys: [RedisKey]) -> EventLoopFuture<Int> {
355355
assert(keys.count > 0, "At least 1 key should be provided.")
@@ -424,7 +424,7 @@ extension RedisClient {
424424
/// See [https://redis.io/commands/sinterstore](https://redis.io/commands/sinterstore)
425425
/// - Parameters:
426426
/// - destination: The key of the new set from the result.
427-
/// - sources: A list of source sets to calculate the intersection of.
427+
/// - keys: A list of source sets to calculate the intersection of.
428428
/// - Returns: The number of elements in the intersection result.
429429
public func sinterstore(as destination: RedisKey, sources keys: [RedisKey]) -> EventLoopFuture<Int> {
430430
assert(keys.count > 0, "At least 1 key should be provided.")
@@ -499,7 +499,7 @@ extension RedisClient {
499499
/// See [https://redis.io/commands/sunionstore](https://redis.io/commands/sunionstore)
500500
/// - Parameters:
501501
/// - destination: The key of the new set from the result.
502-
/// - sources: A list of source sets to calculate the union of.
502+
/// - keys: A list of source sets to calculate the union of.
503503
/// - Returns: The number of elements in the union result.
504504
public func sunionstore(as destination: RedisKey, sources keys: [RedisKey]) -> EventLoopFuture<Int> {
505505
assert(keys.count > 0, "At least 1 key should be provided.")

Sources/RediStack/Commands/SortedSetCommands.swift

+20-14
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ extension RedisClient {
425425
/// - Parameters:
426426
/// - key: The key of the SortedSet that will be counted.
427427
/// - maxScore: The maximum score bound an element in the SortedSet should have in order to be counted.
428-
/// - exclusive: Should the `maxScore` provided be exclusive? If `true`, scores matching the `maxScore` will **not** be counted.
429428
/// - Returns: The count of elements in the SortedSet below the `maxScore` threshold.
430429
public func zcount(of key: RedisKey, withMaximumScoreOf maxScore: RedisZScoreBound) -> EventLoopFuture<Int> {
431430
self.zcount(of: key, withScoresBetween: (.inclusive(-.infinity), maxScore))
@@ -808,7 +807,7 @@ extension RedisClient {
808807
/// - destination: The key of the new sorted set from the result.
809808
/// - sources: The list of sorted set keys to treat as the source of the union.
810809
/// - weights: The multiplying factor to apply to the corresponding `sources` key based on index of the two parameters.
811-
/// - aggregateMethod: The method of aggregating the values of the union. If one isn't specified, Redis will default to `.sum`.
810+
/// - aggregate: The method of aggregating the values of the union. If one isn't specified, Redis will default to `.sum`.
812811
/// - Returns: The number of elements in the new sorted set.
813812
public func zunionstore(
814813
as destination: RedisKey,
@@ -827,7 +826,7 @@ extension RedisClient {
827826
/// - destination: The key of the new sorted set from the result.
828827
/// - sources: The list of sorted set keys to treat as the source of the intersection.
829828
/// - weights: The multiplying factor to apply to the corresponding `sources` key based on index of the two parameters.
830-
/// - aggregateMethod: The method of aggregating the values of the intersection. If one isn't specified, Redis will default to `.sum`.
829+
/// - aggregate: The method of aggregating the values of the intersection. If one isn't specified, Redis will default to `.sum`.
831830
/// - Returns: The number of elements in the new sorted set.
832831
public func zinterstore(
833832
as destination: RedisKey,
@@ -884,6 +883,7 @@ extension RedisClient {
884883
/// - key: The key of the SortedSet
885884
/// - firstIndex: The index of the first element to include in the range of elements returned.
886885
/// - lastIndex: The index of the last element to include in the range of elements returned.
886+
/// - includeScores: If to include scores in result value.
887887
/// - Returns: An array of elements found within the range specified.
888888
public func zrange(
889889
from key: RedisKey,
@@ -927,6 +927,7 @@ extension RedisClient {
927927
/// - Parameters:
928928
/// - key: The key of the SortedSet to return elements from.
929929
/// - range: The range of inclusive indices of elements to get.
930+
/// - includeScores: If to include scores in result value.
930931
/// - Returns: An array of elements found within the range specified.
931932
public func zrange(
932933
from key: RedisKey,
@@ -974,6 +975,7 @@ extension RedisClient {
974975
/// - Parameters:
975976
/// - key: The key of the SortedSet to return elements from.
976977
/// - range: The range of indices (inclusive lower, exclusive upper) elements to get.
978+
/// - includeScores: If to include scores in result value.
977979
/// - Returns: An array of elements found within the range specified.
978980
public func zrange(
979981
from key: RedisKey,
@@ -1007,6 +1009,7 @@ extension RedisClient {
10071009
/// - Parameters:
10081010
/// - key: The key of the SortedSet to return elements from.
10091011
/// - index: The index of the first element that will be in the returned values.
1012+
/// - includeScores: If to include scores in result value.
10101013
/// - Returns: An array of elements from the SortedSet between the index and the end.
10111014
public func zrange(
10121015
from key: RedisKey,
@@ -1035,6 +1038,7 @@ extension RedisClient {
10351038
/// - Parameters:
10361039
/// - key: The key of the SortedSet to return elements from.
10371040
/// - index: The index of the last element that will be in the returned values.
1041+
/// - includeScores: If to include scores in result value.
10381042
/// - Returns: An array of elements from the start of a SortedSet to the index.
10391043
public func zrange(
10401044
from key: RedisKey,
@@ -1238,6 +1242,7 @@ extension RedisClient {
12381242
/// - Parameters:
12391243
/// - key: The key of the SortedSet to return elements from.
12401244
/// - index: The index of the last element that will be in the returned values.
1245+
/// - includeScores: If to include scores in result value.
12411246
/// - Returns: An array of elements from the start of a SortedSet to the index.
12421247
public func zrevrange(
12431248
from key: RedisKey,
@@ -1266,6 +1271,7 @@ extension RedisClient {
12661271
/// - Parameters:
12671272
/// - key: The key of the SortedSet to return elements from.
12681273
/// - index: The index of the last element to not include in the returned values.
1274+
/// - includeScores: If to include scores in result value.
12691275
/// - Returns: An array of elements from the start of the SortedSet and up to the index.
12701276
public func zrevrange(
12711277
from key: RedisKey,
@@ -1385,7 +1391,7 @@ extension RedisClient {
13851391
/// For the inverse, see `zrevrangebyscore(from:withMinimumScoreOf:limitBy:includeScoresInResponse:)`.
13861392
/// - Parameters:
13871393
/// - key: The key of the SortedSet.
1388-
/// - range: The minimum score bound an element in the SortedSet should have to be included in the response.
1394+
/// - minScore: The minimum score bound an element in the SortedSet should have to be included in the response.
13891395
/// - limit: The optional offset and count of elements to query.
13901396
/// - includeScores: Should the response array contain the elements AND their scores? If `true`, the response array will follow the pattern [Item_1, Score_1, Item_2, ...]
13911397
/// - Returns: An array of elements from the SortedSet that were within the range provided, and optionally their scores.
@@ -1411,7 +1417,7 @@ extension RedisClient {
14111417
/// For the inverse, see `zrevrangebyscore(from:withMaximumScoreOf:limitBy:includeScoresInResponse:)`.
14121418
/// - Parameters:
14131419
/// - key: The key of the SortedSet.
1414-
/// - range: The maximum score bound an element in the SortedSet should have to be included in the response.
1420+
/// - maxScore: The maximum score bound an element in the SortedSet should have to be included in the response.
14151421
/// - limit: The optional offset and count of elements to query.
14161422
/// - includeScores: Should the response array contain the elements AND their scores? If `true`, the response array will follow the pattern [Item_1, Score_1, Item_2, ...]
14171423
/// - Returns: An array of elements from the SortedSet that were within the range provided, and optionally their scores.
@@ -1516,8 +1522,8 @@ extension RedisClient {
15161522
/// For the inverse, see `zrangebyscore(from:withMinimumScoreOf:limitBy:includeScoresInResponse:)`.
15171523
/// - Parameters:
15181524
/// - key: The key of the SortedSet.
1519-
/// - range: The minimum score bound an element in the SortedSet should have to be included in the response.
1520-
/// - limit: The optional offset and count of elements to query.
1525+
/// - limit: The minimum score bound an element in the SortedSet should have to be included in the response.
1526+
/// - minScore: The minimum score to compare against.
15211527
/// - includeScores: Should the response array contain the elements AND their scores? If `true`, the response array will follow the pattern [Item_1, Score_1, Item_2, ...]
15221528
/// - Returns: An array of elements from the SortedSet that were within the range provided, and optionally their scores.
15231529
public func zrevrangebyscore(
@@ -1542,8 +1548,8 @@ extension RedisClient {
15421548
/// For the inverse, see `zrangebyscore(from:withMaximumScoreOf:limitBy:includeScoresInResponse:)`.
15431549
/// - Parameters:
15441550
/// - key: The key of the SortedSet.
1545-
/// - range: The maximum score bound an element in the SortedSet should have to be included in the response.
1546-
/// - limit: The optional offset and count of elements to query.
1551+
/// - maxScore: The max score to compare against.
1552+
/// - limit: The maximum score bound an element in the SortedSet should have to be included in the response.
15471553
/// - includeScores: Should the response array contain the elements AND their scores? If `true`, the response array will follow the pattern [Item_1, Score_1, Item_2, ...]
15481554
/// - Returns: An array of elements from the SortedSet that were within the range provided, and optionally their scores.
15491555
public func zrevrangebyscore(
@@ -1605,7 +1611,7 @@ extension RedisClient {
16051611
/// - Parameters:
16061612
/// - key: The key of the SortedSet that will be counted.
16071613
/// - range: The min and max value bounds for filtering elements by.
1608-
/// - limitBy: The optional offset and count of elements to query.
1614+
/// - limit: The optional offset and count of elements to query.
16091615
/// - Returns: An array of elements from the SortedSet that were within the range provided.
16101616
@inlinable
16111617
public func zrangebylex<Value: CustomStringConvertible>(
@@ -1658,7 +1664,7 @@ extension RedisClient {
16581664
/// For the inverse, see `zrevrangebylex(from:withMaximumValueOf:limitBy:)`.
16591665
/// - Parameters:
16601666
/// - key: The key of the SortedSet.
1661-
/// - minValue: The maximum lexiographical value an element in the SortedSet should have to be included in the result set.
1667+
/// - maxValue: The maximum lexiographical value an element in the SortedSet should have to be included in the result set.
16621668
/// - limit: The optional offset and count of elements to query
16631669
/// - Returns: An array of elements from the SortedSet below the `maxValue` threshold.
16641670
@inlinable
@@ -1687,7 +1693,7 @@ extension RedisClient {
16871693
/// - Parameters:
16881694
/// - key: The key of the SortedSet that will be counted.
16891695
/// - range: The min and max value bounds for filtering elements by.
1690-
/// - limitBy: The optional offset and count of elements to query.
1696+
/// - limit: The optional offset and count of elements to query.
16911697
/// - Returns: An array of elements from the SortedSet that were within the range provided.
16921698
@inlinable
16931699
public func zrevrangebylex<Value: CustomStringConvertible>(
@@ -1740,7 +1746,7 @@ extension RedisClient {
17401746
/// For the inverse, see `zrangebylex(from:withMaximumValueOf:limitBy:)`.
17411747
/// - Parameters:
17421748
/// - key: The key of the SortedSet.
1743-
/// - minValue: The maximum lexiographical value an element in the SortedSet should have to be included in the result set.
1749+
/// - maxValue: The maximum lexiographical value an element in the SortedSet should have to be included in the result set.
17441750
/// - limit: The optional offset and count of elements to query
17451751
/// - Returns: An array of elements from the SortedSet below the `maxValue` threshold.
17461752
@inlinable
@@ -2046,7 +2052,7 @@ extension RedisClient {
20462052
/// See `RedisZScoreBound` and [https://redis.io/commands/zremrangebyscore](https://redis.io/commands/zremrangebyscore)
20472053
/// - Parameters:
20482054
/// - key: The key of the SortedSet to remove elements from.
2049-
/// - minScore: The maximum score bound an element in the SortedSet should have to be removed.
2055+
/// - maxScore: The maximum score bound an element in the SortedSet should have to be removed.
20502056
/// - Returns: The count of elements that were removed from the SortedSet.
20512057
public func zremrangebyscore(
20522058
from key: RedisKey,

Sources/RediStack/ConnectionPool/RedisConnectionPool+Configuration.swift

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ extension RedisConnectionPool {
117117
/// Subsequent backoffs are computed by compounding this value by `connectionBackoffFactor`.
118118
/// - connectionRetryTimeout: The max time to wait for a connection to be available before failing a particular command or connection operation.
119119
/// The default is 60 seconds.
120+
/// - onUnexpectedConnectionClose: Called when the connection unexpectedly is closed.
120121
/// - poolDefaultLogger: The `Logger` used by the connection pool itself.
121122
public init(
122123
initialServerConnectionAddresses: [SocketAddress],

Sources/RediStack/ConnectionPool/RedisConnectionPool.swift

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import Logging
1616
import NIOConcurrencyHelpers
1717
import NIOCore
18+
1819
import struct Foundation.UUID
1920

2021
/// A `RedisConnectionPool` is an implementation of `RedisClient` backed by a pool of connections to Redis,

Sources/RediStack/RESP/RESPValue.swift

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ extension EventLoopFuture where Value == RESPValue {
181181
/// This method is intended to be used much like a precondition in synchronous code, where a value is expected to be available from the `RESPValue`.
182182
/// - Important: If the `RESPValueConvertible` initializer fails, then the `NIO.EventLoopFuture` will fail.
183183
/// - Parameter to: The desired type to convert to.
184+
/// - Parameter type: The resulting type.
185+
/// - Parameter file: Source file location where the method was called.
186+
/// - Parameter line: Source line location where the method was called.
184187
/// - Throws: `RedisClientError.failedRESPConversion(to:)`
185188
/// - Returns: A `NIO.EventLoopFuture` that resolves a value of the desired type or fails if the conversion does.
186189
@usableFromInline

Sources/RediStackTestUtils/_Deprecations.swift

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ extension RedisConnection {
2727
/// If `REDIS_PW` is not defined, no authentication will happen on the connection.
2828
/// - Parameters:
2929
/// - eventLoop: The event loop that the connection should execute on.
30+
/// - host: the host to connect to.
3031
/// - port: The port to connect on.
32+
/// - password: The optional password to use while connecting.
3133
/// - Returns: A `NIO.EventLoopFuture` that resolves with the new connection.
3234
@available(*, deprecated, message: "Use RedisConnection.make(configuration:boundEventLoop:) method")
3335
public static func connect(

Sources/RedisTypes/RedisSet.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ extension RedisSet {
140140
/// Removes the given element from the set.
141141
///
142142
/// See `RediStack.RedisClient.srem(_:from:)`
143-
/// - Parameter members: The element in the set to remove.
143+
/// - Parameter member: The element in the set to remove.
144144
/// - Returns: A `NIO.EventLoopFuture<Bool>` resolving `true` if `member` was removed from the set; otherwise, `false`.
145145
public func remove(_ member: Element) -> EventLoopFuture<Bool> {
146146
self.remove([member])

0 commit comments

Comments
 (0)