KoogClock

fun interface KoogClock(source)

Time source used across Koog for message timestamps, event timestamps, and any other "what time is it now" call.

Implement this interface (or use KoogClock.System) anywhere a clock is required. Being a functional interface, simple test doubles can be written as lambdas:

val fixed = KoogClock { Instant.fromEpochSeconds(1_700_000_000) }

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun now(): Instant

Returns the current instant as observed by this clock.