chore: add lab5 files and merge env.example.

This commit is contained in:
Голиков Maximillian Антон
2026-11-14 16:12:32 +03:00
parent 470d9d6f1e
commit 0d1a4261f8
93 changed files with 7085 additions and 11 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} }