RetrostashKtorMetadata

data class RetrostashKtorMetadata(val scopeName: String, val queryTemplate: String? = null, val maxAgeMs: Long = 0, val bindings: Map<String, String> = emptyMap(), val bodyBytes: ByteArray? = null, val invalidateTemplates: List<String> = emptyList(), val tagTemplates: List<String> = emptyList(), val invalidateTagTemplates: List<String> = emptyList())

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.

Constructors

Link copied to clipboard
constructor(scopeName: String, queryTemplate: String? = null, maxAgeMs: Long = 0, bindings: Map<String, String> = emptyMap(), bodyBytes: ByteArray? = null, invalidateTemplates: List<String> = emptyList(), tagTemplates: List<String> = emptyList(), invalidateTagTemplates: List<String> = emptyList())

Properties

Link copied to clipboard

Pre-extracted placeholder values for queryTemplate / invalidateTemplates.

Link copied to clipboard

Optional raw request body — fallback source for placeholders not in bindings (matched via JSON field lookup).

Link copied to clipboard

Tag templates resolved on mutation success and matched against per-entry tag sets in the store.

Link copied to clipboard

Templates to clear after a successful mutation. Resolved against bindings / bodyBytes before being passed to the store.

Link copied to clipboard

TTL for persisted entries in milliseconds. 0 disables persistence even when queryTemplate is set.

Link copied to clipboard

Cache template (e.g. "feed/{id}"). Non-null marks the request as a query candidate for cache lookup and (when maxAgeMs> 0) persistence.

Link copied to clipboard

Logical namespace (typically the API interface name) — prevents key collisions between unrelated APIs sharing template shapes.

Link copied to clipboard

Tag templates persisted with the cached entry on the query side. Resolved against bindings / bodyBytes at write time.