Documentation
¶
Index ¶
- type ChatRepository
- func (c ChatRepository) CreateMsg(ctx context.Context, m *models.Messages) error
- func (r ChatRepository) GetMsg(ctx context.Context, sender string, sender_ip string, recipient string) (*models.Messages, error)
- func (r ChatRepository) SetUserOnlineStatus(ctx context.Context, uID string, isOnline bool) error
- type Messages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRepository ¶
type ChatRepository struct {
// contains filtered or unexported fields
}
func NewMessagesRepository ¶
func NewMessagesRepository( db *mongo.Database, msg_collection string, u_collection string, ) *ChatRepository
func (ChatRepository) SetUserOnlineStatus ¶
type Messages ¶
type Messages struct { ID primitive.ObjectID `bson:"_id,omitempty"` Sender string `bson:"sender"` Recipient string `bson:"recipient"` Content string `bson:"content"` ServerIP string `bson:"server_ip"` SenderIP string `bson:"sender_ip"` IsRead bool `bson:"is_read"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.