Documentation ¶
Index ¶
- Constants
- func IsNotFoundError(err error) bool
- type Chat
- func (c *Chat) GetByChatId(chatId int64) (*models.Chat, error)
- func (c *Chat) Insert(chatId int64, user models.User) error
- func (c *Chat) SetChatGPTToken(chatId int64, chatGPTToken string) error
- func (c *Chat) UpdateLanguage(chatId int64, language models.Language) error
- func (c *Chat) UpdateMode(chatId int64, mode models.Mode) error
- type Message
- type MongoDB
Constants ¶
View Source
const (
ErrorNotFound = "mongo: no documents in result"
)
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
IsNotFoundError checks if the error is a not found error.
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
Chat is a collection of chats.
func (*Chat) GetByChatId ¶
GetByChatId gets a message by chat id.
func (*Chat) SetChatGPTToken ¶
SetChatGPTToken sets the chat GPT token.
func (*Chat) UpdateLanguage ¶
UpdateLanguage updates the language of a chat.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is a collection of messages.
func (*Message) GetLastMessages ¶
GetLastMessages gets the last messages by chat id.
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
MongoDB is a MongoDB database.
func (*MongoDB) ChatCollection ¶
ChatCollection is a collection of chats.
func (*MongoDB) MessageCollection ¶
MessageCollection is a collection of messages.
Click to show internal directories.
Click to hide internal directories.