inmem

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package inmem provides an in-memory implementation of session.Store.

It is intended for tests and local development. Production deployments should use a durable implementation (for example features/session/mongo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory implementation of session.Store. It is safe for concurrent use.

func New

func New() *Store

New returns an empty Store.

func (*Store) CreateSession

func (s *Store) CreateSession(_ context.Context, sessionID string, createdAt time.Time) (session.Session, error)

CreateSession implements session.Store.

func (*Store) EndSession

func (s *Store) EndSession(_ context.Context, sessionID string, endedAt time.Time) (session.Session, error)

EndSession implements session.Store.

func (*Store) LinkChildRun

func (s *Store) LinkChildRun(_ context.Context, parentRunID string, child session.RunMeta) error

LinkChildRun implements session.Store.

Linking is idempotent: the child run ID is appended to the parent's ChildRunIDs only if it is not already present, so repeated links never duplicate entries.

func (*Store) ListRunsBySession

func (s *Store) ListRunsBySession(_ context.Context, sessionID string, statuses []session.RunStatus) ([]session.RunMeta, error)

ListRunsBySession implements session.Store.

func (*Store) LoadRun

func (s *Store) LoadRun(_ context.Context, runID string) (session.RunMeta, error)

LoadRun implements session.Store.

func (*Store) LoadSession

func (s *Store) LoadSession(_ context.Context, sessionID string) (session.Session, error)

LoadSession implements session.Store.

func (*Store) UpsertRun

func (s *Store) UpsertRun(_ context.Context, run session.RunMeta) error

UpsertRun implements session.Store.

ChildRunIDs is intentionally excluded from the update: parent-child links are exclusively managed by LinkChildRun, so callers doing load-modify-write (for example runtime hook handlers) can never erase links committed concurrently by LinkChildRun. Any RunMeta.ChildRunIDs value passed here is ignored and the stored links are preserved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL