Documentation
¶
Index ¶
- func CheckChat(user string, chat string) (string, bool)
- func CreateChat(chat *Chat) error
- func GetChatCol() *mongo.Collection
- func GetCurrUser(claims *jwt.RegisteredClaims, user *User) error
- func GetDatabase() *mongo.Database
- func GetMessageCol() *mongo.Collection
- func GetUserByEmail(email string, user *User) error
- func GetUserById(id primitive.ObjectID, user *User) error
- func GetUserChats(id primitive.ObjectID, chats *[]Chat) error
- func GetUserCol() *mongo.Collection
- func UpdateChat(chat *Chat) error
- type Chat
- type Message
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateChat ¶
func GetChatCol ¶
func GetChatCol() *mongo.Collection
func GetCurrUser ¶
func GetDatabase ¶
func GetMessageCol ¶
func GetMessageCol() *mongo.Collection
func GetUserByEmail ¶
func GetUserCol ¶
func GetUserCol() *mongo.Collection
func UpdateChat ¶
Types ¶
type Message ¶
type Message struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` ChatID primitive.ObjectID `bson:"chat_id,omitempty" json:"chat_id"` FromUserID primitive.ObjectID `bson:"from_user_id,omitempty" json:"from_user_id"` Message string `bson:"message,omitempty" json:"message"` Time primitive.DateTime `bson:"time,omitempty" json:"time"` }
Click to show internal directories.
Click to hide internal directories.