chore: lab import lab4 backend and infrastructure as baseline

This commit is contained in:
Голиков Maximillian Антон
2026-11-06 20:21:23 +03:00
parent 276dbdad8a
commit 4bba40d098
68 changed files with 5315 additions and 0 deletions
@@ -0,0 +1,19 @@
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} }