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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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