postgres

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package postgres provides a PostgreSQL-backed SessionStore. Register type: "session/postgres".

Metadata keys:

dsn   — PostgreSQL DSN (required), e.g. postgres://user:pass@localhost:5432/mydb
table — table name, default daimon_sessions
ttl   — session TTL, e.g. "24h". Default "" (no expiry)

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 a Postgres-backed session store.

func New

func New(cfg session.SessionConfig) (*Store, error)

New creates a Store and initialises the sessions table.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) ([]conversation.Message, error)

func (*Store) Set

func (s *Store) Set(ctx context.Context, id string, messages []conversation.Message) error

Jump to

Keyboard shortcuts

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