Versions in this module Expand all Collapse all v0 v0.1.0 Feb 4, 2024 Changes in this version + func NewConnPool(conf config.Postgres) (*pgxpool.Pool, error) + type DialogRepository struct + func NewDialogRepository(pool *pgxpool.Pool) *DialogRepository + func (r *DialogRepository) Create(ctx context.Context, dialog *entity.Dialog) error + func (r *DialogRepository) GetByID(ctx context.Context, dialogID int) (entity.Dialog, error) + func (r *DialogRepository) List(ctx context.Context) ([]entity.Dialog, error) + func (r *DialogRepository) Update(ctx context.Context, dialog *entity.Dialog) error + type GroupParticipantRepository struct + func NewGroupParticipantRepository(pool *pgxpool.Pool) *GroupParticipantRepository + func (r *GroupParticipantRepository) Create(ctx context.Context, participant *entity.GroupParticipant) error + func (r *GroupParticipantRepository) Get(ctx context.Context, groupID, userID int, withLock bool) (entity.GroupParticipant, error) + func (r *GroupParticipantRepository) List(ctx context.Context, groupID int) ([]entity.GroupParticipant, error) + func (r *GroupParticipantRepository) Update(ctx context.Context, participant *entity.GroupParticipant) error + type GroupRepository struct + func NewGroupRepository(pool *pgxpool.Pool) *GroupRepository + func (r *GroupRepository) Create(ctx context.Context, group *entity.Group) error + func (r *GroupRepository) Delete(ctx context.Context, groupID int) error + func (r *GroupRepository) GetByID(ctx context.Context, groupID int) (entity.Group, error) + func (r *GroupRepository) List(ctx context.Context) ([]entity.Group, error) + func (r *GroupRepository) Update(ctx context.Context, group *entity.Group) error + type MessageRepository struct + func NewMessageRepository(pool *pgxpool.Pool) *MessageRepository + func (r *MessageRepository) Create(ctx context.Context, message *entity.Message) error + func (r *MessageRepository) List(ctx context.Context, obj dto.MessageList) ([]entity.Message, error) + type TransactionManager struct + func NewTransactionManager(pool *pgxpool.Pool) *TransactionManager + func (txm *TransactionManager) Do(ctx context.Context, fn func(ctx context.Context) error) error + type UserRepository struct + func NewUserRepository(pool *pgxpool.Pool) *UserRepository + func (r *UserRepository) Create(ctx context.Context, user *entity.User) error + func (r *UserRepository) Delete(ctx context.Context, id int) error + func (r *UserRepository) GetByID(ctx context.Context, id int) (entity.User, error) + func (r *UserRepository) GetByUsername(ctx context.Context, username string) (entity.User, error) + func (r *UserRepository) List(ctx context.Context) ([]entity.User, error) + func (r *UserRepository) Update(ctx context.Context, user *entity.User) error + func (r *UserRepository) UpdatePassword(ctx context.Context, userID int, pwdHash string) error