postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package postgres provides a Postgres-backed storage.Storage implementation built on top of sqlc-generated queries and pgx/v5.

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 the Postgres-backed storage adapter.

func New

func New(pool *pgxpool.Pool) *Store

New constructs a Store using the given pgxpool.Pool.

func (s *Store) ConsumeMagicLink(ctx context.Context, tokenHash []byte) (*theauth.MagicLink, error)
func (s *Store) CreateMagicLink(ctx context.Context, ml theauth.MagicLink) error

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, sess theauth.Session) (theauth.Session, error)

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, u theauth.User) (theauth.User, error)

func (*Store) MarkEmailVerified

func (s *Store) MarkEmailVerified(ctx context.Context, userID theauth.ULID) error

func (*Store) RevokeSession

func (s *Store) RevokeSession(ctx context.Context, id theauth.ULID) error

func (*Store) RevokeUserSessions

func (s *Store) RevokeUserSessions(ctx context.Context, userID theauth.ULID) error

func (*Store) SessionByTokenHash

func (s *Store) SessionByTokenHash(ctx context.Context, hash []byte) (*theauth.Session, error)

func (*Store) UserByEmail

func (s *Store) UserByEmail(ctx context.Context, email string) (*theauth.User, error)

func (*Store) UserByID

func (s *Store) UserByID(ctx context.Context, id theauth.ULID) (*theauth.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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