GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — InMemorySessionService | ADK for TypeScript: API Reference - v2.5.0

  • InMemorySessionService

Class InMemorySessionService

An in-memory implementation of the session service.

Every map below is keyed by untrusted input — appName, userId, sessionId and state keys all arrive straight off the request path or body on a dev server — so each is created with Object.create(null). On an ordinary {} literal a key of __proto__ resolves to the inherited __proto__ accessor instead of creating an own property, so map[appName][userId] = ... writes onto Object.prototype and pollutes every object in the process. A null-prototype map has no such accessor, so those keys become ordinary own properties.

Hierarchy (View Summary)

  • BaseSessionService
    • InMemorySessionService
  • Defined in core/src/sessions/in_memory_session_service.ts:45

Constructors

constructor

  • new InMemorySessionService(): InMemorySessionService

    Returns InMemorySessionService

    Inherited from BaseSessionService.constructor

Methods

appendEvent

  • appendEvent(request: AppendEventRequest): Promise<Event>

    Appends an event to a session.

    Parameters

    • request: AppendEventRequest

      The request to append an event.

    Returns Promise<Event>

    A promise that resolves to the event that was appended.

    Overrides BaseSessionService.appendEvent

    • Defined in core/src/sessions/in_memory_session_service.ts:271

createSession

  • createSession(request: CreateSessionRequest): Promise<Session>

    Creates a new session.

    Parameters

    • request: CreateSessionRequest

      The request to create a session.

    Returns Promise<Session>

    A promise that resolves to the newly created session instance.

    Overrides BaseSessionService.createSession

    • Defined in core/src/sessions/in_memory_session_service.ts:65

deleteSession

  • deleteSession(request: CompositeSessionKey): Promise<void>

    Deletes a session.

    Parameters

    • request: CompositeSessionKey

      The request to delete a session.

    Returns Promise<void>

    A promise that resolves when the session is deleted.

    Overrides BaseSessionService.deleteSession

    • Defined in core/src/sessions/in_memory_session_service.ts:257

getOrCreateSession

  • getOrCreateSession(request: CreateSessionRequest): Promise<Session>

    Gets a session or creates one if it doesn't exist.

    Parameters

    • request: CreateSessionRequest

      The request to get or create a session.

    Returns Promise<Session>

    A promise that resolves to the session instance.

    Inherited from BaseSessionService.getOrCreateSession

    • Defined in core/src/sessions/base_session_service.ts:130

getSession

  • getSession(request: GetSessionRequest): Promise<Session | undefined>

    Gets a session.

    Parameters

    • request: GetSessionRequest

      The request to get a session.

    Returns Promise<Session | undefined>

    A promise that resolves to the session instance or undefined if not found.

    Overrides BaseSessionService.getSession

    • Defined in core/src/sessions/in_memory_session_service.ts:102

listSessions

  • listSessions(request: ListSessionsRequest): Promise<ListSessionsResponse>

    Lists sessions for a user.

    Parameters

    • request: ListSessionsRequest

      The request to list sessions.

    Returns Promise<ListSessionsResponse>

    A promise that resolves to a list of sessions for the user.

    Overrides BaseSessionService.listSessions

    • Defined in core/src/sessions/in_memory_session_service.ts:148
Constructors
constructor
Methods
appendEventcreateSessiondeleteSessiongetOrCreateSessiongetSessionlistSessions
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.