Documentation
¶
Index ¶
- func NewChatParticipantsRepository(db *gorm.DB) repositories.ChatParticipantsRepository
- func NewChatRepository(db *gorm.DB) repositories.ChatRepository
- func NewMessageRepository(db *gorm.DB) repositories.MessageRepository
- func NewTokenRepository(db *gorm.DB) repositories.TokenRepository
- func NewUserRepository(db *gorm.DB) repositories.UserRepository
- type GormChatParticipantsRepository
- type GormChatRepository
- func (g *GormChatRepository) Create(ctx context.Context, chat *models.Chat) error
- func (g *GormChatRepository) DeleteByID(ctx context.Context, id string) error
- func (g *GormChatRepository) GetAll(ctx context.Context, offset int, limit int) ([]models.Chat, error)
- func (g *GormChatRepository) GetByID(ctx context.Context, id string) (*models.Chat, error)
- func (g *GormChatRepository) GetByUser(ctx context.Context, userID string, offset int, limit int) ([]models.Chat, error)
- func (g *GormChatRepository) Update(ctx context.Context, chat *models.Chat) error
- func (g *GormChatRepository) UpdateName(ctx context.Context, id string, name string) error
- type GormMessageRepository
- func (g *GormMessageRepository) Create(ctx context.Context, message *models.Message) error
- func (g *GormMessageRepository) DeleteByChat(ctx context.Context, chatID string) error
- func (g *GormMessageRepository) DeleteByID(ctx context.Context, id string) error
- func (g *GormMessageRepository) GetAll(ctx context.Context, offset int, limit int) ([]models.Message, error)
- func (g *GormMessageRepository) GetByChat(ctx context.Context, chatID string, offset int, limit int, order string) ([]models.Message, error)
- func (g *GormMessageRepository) GetByID(ctx context.Context, id string) (*models.Message, error)
- func (g *GormMessageRepository) GetFromID(ctx context.Context, chatID string, startFrom string, limit int, order string) ([]models.Message, error)
- func (g *GormMessageRepository) GetLastInChat(ctx context.Context, chatID string) (*models.Message, error)
- func (g *GormMessageRepository) Update(ctx context.Context, message *models.Message) error
- type GormTokenRepository
- func (g *GormTokenRepository) Create(ctx context.Context, token *models.Token) error
- func (g *GormTokenRepository) DeleteExpiredTokens(ctx context.Context) error
- func (g *GormTokenRepository) DeleteToken(ctx context.Context, tokenString string) error
- func (g *GormTokenRepository) DeleteTokensByUser(ctx context.Context, userID string) error
- func (g *GormTokenRepository) GetToken(ctx context.Context, tokenString string) (*models.Token, error)
- type GormUserRepository
- func (g *GormUserRepository) Create(ctx context.Context, user *models.User) error
- func (g *GormUserRepository) DeleteByID(ctx context.Context, id string) error
- func (g *GormUserRepository) GetAll(ctx context.Context) ([]models.User, error)
- func (g *GormUserRepository) GetByID(ctx context.Context, id string) (*models.User, error)
- func (g *GormUserRepository) GetByUsername(ctx context.Context, username string) (*models.User, error)
- func (g *GormUserRepository) Update(ctx context.Context, user *models.User) error
- func (g *GormUserRepository) UpdateStatus(ctx context.Context, id string, status string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChatParticipantsRepository ¶
func NewChatParticipantsRepository(db *gorm.DB) repositories.ChatParticipantsRepository
func NewChatRepository ¶
func NewChatRepository(db *gorm.DB) repositories.ChatRepository
func NewMessageRepository ¶
func NewMessageRepository(db *gorm.DB) repositories.MessageRepository
func NewTokenRepository ¶
func NewTokenRepository(db *gorm.DB) repositories.TokenRepository
func NewUserRepository ¶
func NewUserRepository(db *gorm.DB) repositories.UserRepository
Types ¶
type GormChatParticipantsRepository ¶
type GormChatParticipantsRepository struct {
// contains filtered or unexported fields
}
func (*GormChatParticipantsRepository) AddUserToChat ¶
func (g *GormChatParticipantsRepository) AddUserToChat(ctx context.Context, chatID string, userID string) error
AddUserToChat implements repositories.ChatParticipantsRepository.
func (*GormChatParticipantsRepository) RemoveUserFromChat ¶
func (g *GormChatParticipantsRepository) RemoveUserFromChat(ctx context.Context, chatID string, userID string) error
RemoveUserFromChat implements repositories.ChatParticipantsRepository.
type GormChatRepository ¶
type GormChatRepository struct {
// contains filtered or unexported fields
}
func (*GormChatRepository) DeleteByID ¶
func (g *GormChatRepository) DeleteByID(ctx context.Context, id string) error
DeleteByID implements repositories.ChatRepository.
func (*GormChatRepository) GetAll ¶
func (g *GormChatRepository) GetAll(ctx context.Context, offset int, limit int) ([]models.Chat, error)
GetAll implements repositories.ChatRepository.
func (*GormChatRepository) GetByUser ¶
func (g *GormChatRepository) GetByUser(ctx context.Context, userID string, offset int, limit int) ([]models.Chat, error)
GetByUser implements repositories.ChatRepository.
func (*GormChatRepository) UpdateName ¶
UpdateName implements repositories.ChatRepository.
type GormMessageRepository ¶
type GormMessageRepository struct {
// contains filtered or unexported fields
}
func (*GormMessageRepository) DeleteByChat ¶
func (g *GormMessageRepository) DeleteByChat(ctx context.Context, chatID string) error
DeleteByChat implements repositories.MessageRepository.
func (*GormMessageRepository) DeleteByID ¶
func (g *GormMessageRepository) DeleteByID(ctx context.Context, id string) error
DeleteByID implements repositories.MessageRepository.
func (*GormMessageRepository) GetAll ¶
func (g *GormMessageRepository) GetAll(ctx context.Context, offset int, limit int) ([]models.Message, error)
GetAll implements repositories.MessageRepository.
func (*GormMessageRepository) GetByChat ¶
func (g *GormMessageRepository) GetByChat(ctx context.Context, chatID string, offset int, limit int, order string) ([]models.Message, error)
GetByChat implements repositories.MessageRepository.
func (*GormMessageRepository) GetFromID ¶
func (g *GormMessageRepository) GetFromID(ctx context.Context, chatID string, startFrom string, limit int, order string) ([]models.Message, error)
GetFromID implements repositories.MessageRepository.
func (*GormMessageRepository) GetLastInChat ¶
func (g *GormMessageRepository) GetLastInChat(ctx context.Context, chatID string) (*models.Message, error)
GetLastInChat implements repositories.MessageRepository.
type GormTokenRepository ¶
type GormTokenRepository struct {
// contains filtered or unexported fields
}
func (*GormTokenRepository) DeleteExpiredTokens ¶
func (g *GormTokenRepository) DeleteExpiredTokens(ctx context.Context) error
DeleteExpiredTokens implements repositories.TokenRepository.
func (*GormTokenRepository) DeleteToken ¶
func (g *GormTokenRepository) DeleteToken(ctx context.Context, tokenString string) error
DeleteToken implements repositories.TokenRepository.
func (*GormTokenRepository) DeleteTokensByUser ¶
func (g *GormTokenRepository) DeleteTokensByUser(ctx context.Context, userID string) error
DeleteTokensByUser implements repositories.TokenRepository.
type GormUserRepository ¶
type GormUserRepository struct {
// contains filtered or unexported fields
}
func (*GormUserRepository) DeleteByID ¶
func (g *GormUserRepository) DeleteByID(ctx context.Context, id string) error
DeleteByID implements repositories.UserRepository.
func (*GormUserRepository) GetByUsername ¶
func (g *GormUserRepository) GetByUsername(ctx context.Context, username string) (*models.User, error)
GetByUsername implements repositories.UserRepository.
func (*GormUserRepository) UpdateStatus ¶
UpdateStatus implements repositories.UserRepository.