postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 7 Imported by: ? modules, 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.

README

Postgres storage adapter

Placeholder for SQL/Postgres implementation. Recommended packages:

  • github.com/jackc/pgx/v5
  • github.com/golang-migrate/migrate/v4

Core should depend only on storage.Store, not directly on pgx.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatRepo

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

func (*ChatRepo) FindByPlatformID

func (r *ChatRepo) FindByPlatformID(ctx context.Context, platform, chatID string) (*storage.Chat, error)

func (*ChatRepo) List

func (r *ChatRepo) List(ctx context.Context) ([]storage.Chat, error)

func (*ChatRepo) Save

func (r *ChatRepo) Save(ctx context.Context, chat *storage.Chat) error

type SessionRepo

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

func (*SessionRepo) Delete

func (r *SessionRepo) Delete(ctx context.Context, key string) error

func (*SessionRepo) Get

func (r *SessionRepo) Get(ctx context.Context, key string) ([]byte, error)

func (*SessionRepo) Set

func (r *SessionRepo) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

type Store

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

func New

func New(ctx context.Context, dsn string) (*Store, error)

func NewWithPool

func NewWithPool(pool *pgxpool.Pool) *Store

func (*Store) Chats

func (s *Store) Chats() storage.ChatRepository

func (*Store) Close

func (s *Store) Close()

func (*Store) EnsureSchema

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

func (*Store) Sessions

func (s *Store) Sessions() storage.SessionRepository

func (*Store) Users

func (s *Store) Users() storage.UserRepository

type UserRepo

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

func (*UserRepo) FindByID

func (r *UserRepo) FindByID(ctx context.Context, id string) (*storage.User, error)

func (*UserRepo) FindByPlatformID

func (r *UserRepo) FindByPlatformID(ctx context.Context, platform, platformID string) (*storage.User, error)

func (*UserRepo) List

func (r *UserRepo) List(ctx context.Context) ([]storage.User, error)

func (*UserRepo) Save

func (r *UserRepo) Save(ctx context.Context, user *storage.User) error

Jump to

Keyboard shortcuts

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