postgres

package
v1.97.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package postgres provides a PostgreSQL-backed searchgate.Store so the search-first gate's per-session discovery signal is shared across replicas.

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 implements searchgate.Store using PostgreSQL.

func New

func New(db *sql.DB, ttl time.Duration) *Store

New creates a PostgreSQL discovery store. Discovery records expire ttl after the most recent MarkDiscovered.

func (*Store) Cleanup

func (s *Store) Cleanup(ctx context.Context) error

Cleanup deletes expired discovery records.

func (*Store) Close

func (*Store) Close() error

Close is a no-op; the underlying *sql.DB is owned by the platform.

func (*Store) HasDiscovered

func (s *Store) HasDiscovered(ctx context.Context, sessionID string) (bool, error)

HasDiscovered reports whether the session has a non-expired discovery record.

func (*Store) MarkDiscovered

func (s *Store) MarkDiscovered(ctx context.Context, sessionID string) error

MarkDiscovered records discovery for the session, upserting its expiry.

Jump to

Keyboard shortcuts

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