Documentation
¶
Index ¶
- type ChatStorage
- func (r *ChatStorage) AddChat(ctx context.Context, chat entities.Chat) (entities.Chat, error)
- func (r *ChatStorage) DeleteChatByCompanyId(ctx context.Context, id int) error
- func (r *ChatStorage) DeleteChatById(ctx context.Context, id int64) error
- func (s *ChatStorage) GetChatsByCompanyId(ctx context.Context, id int64) ([]entities.Chat, error)
- func (s *ChatStorage) GetChatsByCompanyToken(ctx context.Context, t string) ([]entities.Chat, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatStorage ¶
type ChatStorage struct {
// contains filtered or unexported fields
}
ChatStorage is a storage implementation for chats using PostgreSQL.
func New ¶
func New(db *sqlx.DB) *ChatStorage
New returns a new instance of ChatStorage with the given database connection.
func (*ChatStorage) AddChat ¶
AddChat adds a new chat to the database and returns the newly created chat entity.
func (*ChatStorage) DeleteChatByCompanyId ¶
func (r *ChatStorage) DeleteChatByCompanyId(ctx context.Context, id int) error
DeleteChatByCompanyId deletes all chats from the database that belong to the company with the given ID.
func (*ChatStorage) DeleteChatById ¶
func (r *ChatStorage) DeleteChatById(ctx context.Context, id int64) error
DeleteChatById deletes a chat from the database by its ID.
func (*ChatStorage) GetChatsByCompanyId ¶
GetChatsByCompanyId returns a slice of entities.Chat that belong to the company with the given ID.
func (*ChatStorage) GetChatsByCompanyToken ¶
func (s *ChatStorage) GetChatsByCompanyToken(ctx context.Context, t string) ([]entities.Chat, error)
GetChatsByCompanyToken returns a slice of entities.Chat that belong to the company with the given token.
Click to show internal directories.
Click to hide internal directories.