# Package-level declarations

## Types

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

Configuration for getting a session.

InMemorySessionService
Link copied to clipboard
class InMemorySessionService : SessionService

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

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

Response for listing events.

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

Response for listing sessions.

Lock
Link copied to clipboard
interface Lock

A read/write lock.

Session
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.

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

Composite identifier for a Session.

SessionService
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.

State
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

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

Creates a new Lock.