chore: get files from lab6

This commit is contained in:
Голиков Maximillian Антон
2026-11-24 22:32:11 +03:00
parent 20afc2c790
commit 9b88c6f0bd
118 changed files with 9682 additions and 0 deletions
@@ -0,0 +1,22 @@
package postgres
import "github.com/jackc/pgx/v5/pgxpool"
type Storage struct {
pool *pgxpool.Pool
}
func New(pool *pgxpool.Pool) *Storage {
return &Storage{pool: pool}
}
func (s *Storage) Pool() *pgxpool.Pool { return s.pool }
func (s *Storage) Users() *UserRepo { return &UserRepo{pool: s.pool} }
func (s *Storage) Chats() *ChatRepo { return &ChatRepo{pool: s.pool} }
func (s *Storage) Messages() *MessageRepo { return &MessageRepo{pool: s.pool} }
func (s *Storage) Sessions() *SessionRepo { return &SessionRepo{pool: s.pool} }
func (s *Storage) Attachments() *AttachmentRepo { return &AttachmentRepo{pool: s.pool} }
func (s *Storage) Outbox() *OutboxRepo { return &OutboxRepo{pool: s.pool} }
func (s *Storage) Variants() *AttachmentVariantRepo { return &AttachmentVariantRepo{pool: s.pool} }
func (s *Storage) FailedJobs() *FailedJobRepo { return &FailedJobRepo{pool: s.pool} }