SQLiteCache

data class SQLiteCache(path: Path)

A simple SQLite-backed cache for storing HTTP query responses.

Parameters

path

The filesystem path to the SQLite database file. If it doesn't exist, it will be created.

Constructors

Link copied to clipboard
constructor(path: Path)

Functions

Link copied to clipboard
fun delete(url: String)

Deletes a cached entry for the given url.

Link copied to clipboard
fun insert(data: CacheData)
fun insert(url: String, response: String, retrievedAt: Instant = Clock.System.now(), lastModified: Instant?)

Inserts or updates a cached entry.

Link copied to clipboard
fun select(url: String): CacheData?

Retrieves a cached response for the given url.