-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from momentohq/add-list-caches
chore: add list caches API
- Loading branch information
Showing
8 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/commonMain/kotlin/software/momento/kotlin/sdk/responses/cache/control/CacheInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package software.momento.kotlin.sdk.responses.cache.control | ||
|
||
/** Information about a cache. | ||
* @param name the cache name | ||
* */ | ||
public data class CacheInfo(public val name: String) |
18 changes: 18 additions & 0 deletions
18
...ommonMain/kotlin/software/momento/kotlin/sdk/responses/cache/control/CacheListResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package software.momento.kotlin.sdk.responses.cache.control | ||
|
||
import software.momento.kotlin.sdk.exceptions.SdkException | ||
|
||
/** Response for a list caches operation. */ | ||
public sealed interface CacheListResponse { | ||
|
||
/** A successful list caches operation. Contains the discovered caches. */ | ||
public data class Success(val caches: List<CacheInfo>) : CacheListResponse | ||
|
||
/** | ||
* A failed list caches operation. The response itself is an exception, so it can be directly | ||
* thrown, or the cause of the error can be retrieved with [.getCause]. The message is a | ||
* copy of the message of the cause. | ||
*/ | ||
public class Error(cause: SdkException) : SdkException(cause), CacheListResponse | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters