Package-level declarations

Types

Link copied to clipboard
data class GetSessionConfig(val numRecentEvents: Int? = null, val afterTimestamp: Instant? = null)

Configuration for getting a session.

Link copied to clipboard

An in-memory implementation of SessionService assuming Session objects are mutable regarding their state map, events list, and last update time.

Link copied to clipboard
data class ListEventsResponse(val events: List<Event> = emptyList(), val nextPageToken: String? = null)

Response for listing events.

Link copied to clipboard
data class ListSessionsResponse(val sessions: List<Session> = emptyList())

Response for listing sessions.

Link copied to clipboard
interface Lock

A read/write lock.

Link copied to clipboard
data class Session(val key: SessionKey, val state: State = State(), val events: MutableList<Event> = mutableListOf(), var lastUpdateTime: Instant = Instant.fromEpochMilliseconds(0))

A Session object that encapsulates the State and Events of a session.

Link copied to clipboard
data class SessionKey(val appName: String, val userId: String, val id: String?)

Composite identifier for a Session.

Link copied to clipboard
interface SessionService

Defines the contract for managing Sessions and their associated Events. Provides methods for creating, retrieving, listing, and deleting sessions, as well as listing and appending events to a session. Implementations of this interface handle the underlying storage and retrieval logic.

Link copied to clipboard
class State(initialState: Map<String, Any> = emptyMap(), initialDelta: Map<String, Any> = emptyMap()) : Map<String, Any>

A thread-safe state map that maintains the current value and tracks modifications.

Functions

Link copied to clipboard
actual fun Lock(): Lock
expect fun Lock(): Lock

Creates a new Lock.