From 8f8936bc14f90134948bbe564ac565ee458a3eb2 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Thu, 14 Nov 2024 14:36:23 +0000 Subject: [PATCH] Add .spi.yml so that DocC documentation is generated --- .spi.yml | 4 ++++ Sources/Memcache/MemcacheConnection.swift | 7 +++++-- Sources/Memcache/MemcacheError.swift | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .spi.yml diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..8e0c6d4 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,4 @@ +version: 1 +builder: + configs: + - documentation_targets: [Memcache] diff --git a/Sources/Memcache/MemcacheConnection.swift b/Sources/Memcache/MemcacheConnection.swift index 1991730..49d0cb4 100644 --- a/Sources/Memcache/MemcacheConnection.swift +++ b/Sources/Memcache/MemcacheConnection.swift @@ -211,9 +211,12 @@ public actor MemcacheConnection: Service { /// Fetch the value for a key from the Memcache server. /// - /// - Parameter key: The key to fetch the value for. + /// - Parameters: + /// - key: The key to fetch the value for. + /// - valueType: The type of the returned `Value` /// - Returns: A `Value` containing the fetched value, or `nil` if no value was found. /// - Throws: A `MemcacheError` that indicates the failure. + public func get(_ key: String, as valueType: Value.Type = Value.self) async throws -> Value? { var flags = MemcacheFlags() flags.shouldReturnValue = true @@ -262,7 +265,7 @@ public actor MemcacheConnection: Service { /// - Parameters: /// - key: The key for which the value is to be set. /// - value: The `MemcacheValue` to set for the key. - /// - expiration: An optional `TimeToLive` value specifying the TTL (Time-To-Live) for the key-value pair. + /// - timeToLive: An optional `TimeToLive` value specifying the TTL (Time-To-Live) for the key-value pair. /// If provided, the key-value pair will be removed from the cache after the specified TTL duration has passed. /// If not provided, the key-value pair will persist indefinitely in the cache. /// - Throws: A `MemcacheError` that indicates the failure. diff --git a/Sources/Memcache/MemcacheError.swift b/Sources/Memcache/MemcacheError.swift index e46c59a..ea7cf18 100644 --- a/Sources/Memcache/MemcacheError.swift +++ b/Sources/Memcache/MemcacheError.swift @@ -187,7 +187,7 @@ extension MemcacheError { self.code = code } - /// The ``MemcacheConection`` is already shutdown. + /// The ``MemcacheConnection`` is already shutdown. public static var connectionShutdown: Self { Self(.connectionShutdown) }