Package-level declarations
Types
Configuration for RetrostashPlugin. Set within install(RetrostashPlugin) { ... }:
Direct cache control for the Ktor adapter — peek, update, invalidate*, clearAll. All methods are suspend; call from any coroutine. Mirror surface of RetrostashOkHttpCache but uses scopeName: String instead of Class<*> for KMP compatibility, and stores raw bytes (no envelope — Ktor doesn't synthesize HTTP responses on cache hit, the plugin hands the bytes back via RetrostashCachedPayloadKey).
Per-request Retrostash metadata attached to a Ktor HttpRequestBuilder via retrostash, retrostashQuery, or retrostashMutate. Read by RetrostashPlugin on request and response hooks to drive cache lookup, persistence, and invalidation.
Thin adapter that translates RetrostashKtorMetadata into QueryMetadata for the underlying RetrostashEngine. Used by RetrostashPlugin; can also be used directly for testing without spinning up a Ktor HttpClient.
Properties
Attribute key set by RetrostashPlugin on cache hits. Read after the request completes to branch on cache vs network:
Attribute key used to attach RetrostashKtorMetadata to a Ktor request.
Ktor HttpClient plugin that adds annotation-style query caching and mutation invalidation.
Functions
Attaches or merges metadata onto this request. Existing metadata fields are preserved when incoming values are blank/null/empty.
Marks this request as a Retrostash mutation. On a 2xx response, RetrostashPlugin resolves each entry in invalidateTemplates against bindings / bodyBytes and removes matching cache entries.
Marks this request as a Retrostash query. On hit, the plugin returns the cached payload via RetrostashCachedPayloadKey. On miss, the response is persisted (if maxAgeMs> 0) on a 2xx status code.