repositories

package
v0.0.0-...-3be0e83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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) Create

func (g *GormChatRepository) Create(ctx context.Context, chat *models.Chat) error

Create implements repositories.ChatRepository.

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) GetByID

func (g *GormChatRepository) GetByID(ctx context.Context, id string) (*models.Chat, error)

GetByID 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) Update

func (g *GormChatRepository) Update(ctx context.Context, chat *models.Chat) error

Update implements repositories.ChatRepository.

func (*GormChatRepository) UpdateName

func (g *GormChatRepository) UpdateName(ctx context.Context, id string, name string) error

UpdateName implements repositories.ChatRepository.

type GormMessageRepository

type GormMessageRepository struct {
	// contains filtered or unexported fields
}

func (*GormMessageRepository) Create

func (g *GormMessageRepository) Create(ctx context.Context, message *models.Message) error

Create implements repositories.MessageRepository.

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) GetByID

GetByID 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.

func (*GormMessageRepository) Update

func (g *GormMessageRepository) Update(ctx context.Context, message *models.Message) error

Update implements repositories.MessageRepository.

type GormTokenRepository

type GormTokenRepository struct {
	// contains filtered or unexported fields
}

func (*GormTokenRepository) Create

func (g *GormTokenRepository) Create(ctx context.Context, token *models.Token) error

Create implements repositories.TokenRepository.

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.

func (*GormTokenRepository) GetToken

func (g *GormTokenRepository) GetToken(ctx context.Context, tokenString string) (*models.Token, error)

GetToken implements repositories.TokenRepository.

type GormUserRepository

type GormUserRepository struct {
	// contains filtered or unexported fields
}

func (*GormUserRepository) Create

func (g *GormUserRepository) Create(ctx context.Context, user *models.User) error

Create implements repositories.UserRepository.

func (*GormUserRepository) DeleteByID

func (g *GormUserRepository) DeleteByID(ctx context.Context, id string) error

DeleteByID implements repositories.UserRepository.

func (*GormUserRepository) GetAll

func (g *GormUserRepository) GetAll(ctx context.Context) ([]models.User, error)

GetAll implements repositories.UserRepository.

func (*GormUserRepository) GetByID

func (g *GormUserRepository) GetByID(ctx context.Context, id string) (*models.User, error)

GetByID implements repositories.UserRepository.

func (*GormUserRepository) GetByUsername

func (g *GormUserRepository) GetByUsername(ctx context.Context, username string) (*models.User, error)

GetByUsername implements repositories.UserRepository.

func (*GormUserRepository) Update

func (g *GormUserRepository) Update(ctx context.Context, user *models.User) error

Update implements repositories.UserRepository.

func (*GormUserRepository) UpdateStatus

func (g *GormUserRepository) UpdateStatus(ctx context.Context, id string, status string) error

UpdateStatus implements repositories.UserRepository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL