Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- func NewBlackMongo(db *mongo.Database) (database.Black, error)
- func NewFriendMongo(db *mongo.Database) (database.Friend, error)
- func NewFriendRequestMongo(db *mongo.Database) (database.FriendRequest, error)
- func NewGroupMember(db *mongo.Database) (database.GroupMember, error)
- func NewGroupMongo(db *mongo.Database) (database.Group, error)
- func NewGroupRequestMgo(db *mongo.Database) (database.GroupRequest, error)
- func NewLogMongo(db *mongo.Database) (database.Log, error)
- func NewMsgMongo(db *mongo.Database) (database.Msg, error)
- func NewS3Mongo(db *mongo.Database) (database.ObjectInfo, error)
- func NewSeqConversationMongo(db *mongo.Database) (database.SeqConversation, error)
- func NewSeqUserMongo(db *mongo.Database) (database.SeqUser, error)
- func NewUserMongo(db *mongo.Database) (database.User, error)
- func NewVersionLog(coll *mongo.Collection) (database.VersionLog, error)
- type BlackMgo
- func (b *BlackMgo) Create(ctx context.Context, blacks []*model.Black) (err error)
- func (b *BlackMgo) Delete(ctx context.Context, blacks []*model.Black) (err error)
- func (b *BlackMgo) Find(ctx context.Context, blacks []*model.Black) (blackList []*model.Black, err error)
- func (b *BlackMgo) FindBlackUserIDs(ctx context.Context, ownerUserID string) (blackUserIDs []string, err error)
- func (b *BlackMgo) FindOwnerBlackInfos(ctx context.Context, ownerUserID string, userIDs []string) (blacks []*model.Black, err error)
- func (b *BlackMgo) FindOwnerBlacks(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (total int64, blacks []*model.Black, err error)
- func (b *BlackMgo) Take(ctx context.Context, ownerUserID, blockUserID string) (black *model.Black, err error)
- func (b *BlackMgo) UpdateByMap(ctx context.Context, ownerUserID, blockUserID string, args map[string]any) (err error)
- type ConversationMgo
- func (c *ConversationMgo) Create(ctx context.Context, conversations []*model.Conversation) (err error)
- func (c *ConversationMgo) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*model.Conversation, err error)
- func (c *ConversationMgo) FindConversationID(ctx context.Context, userID string, conversationIDs []string) (existConversationID []string, err error)
- func (c *ConversationMgo) FindConversationUserVersion(ctx context.Context, userID string, version uint, limit int) (*model.VersionLog, error)
- func (c *ConversationMgo) FindRecvMsgUserIDs(ctx context.Context, conversationID string, recvOpts []int) ([]string, error)
- func (c *ConversationMgo) FindUserID(ctx context.Context, userIDs []string, conversationIDs []string) ([]string, error)
- func (c *ConversationMgo) FindUserIDAllConversationID(ctx context.Context, userID string) ([]string, error)
- func (c *ConversationMgo) FindUserIDAllConversations(ctx context.Context, userID string) (conversations []*model.Conversation, err error)
- func (c *ConversationMgo) FindUserIDAllNotNotifyConversationID(ctx context.Context, userID string) ([]string, error)
- func (c *ConversationMgo) FindUserIDAllPinnedConversationID(ctx context.Context, userID string) ([]string, error)
- func (c *ConversationMgo) GetAllConversationIDs(ctx context.Context) ([]string, error)
- func (c *ConversationMgo) GetAllConversationIDsNumber(ctx context.Context) (int64, error)
- func (c *ConversationMgo) GetConversationIDsNeedDestruct(ctx context.Context) ([]*model.Conversation, error)
- func (c *ConversationMgo) GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error)
- func (c *ConversationMgo) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*model.Conversation, error)
- func (c *ConversationMgo) GetUserRecvMsgOpt(ctx context.Context, ownerUserID, conversationID string) (opt int, err error)
- func (c *ConversationMgo) PageConversationIDs(ctx context.Context, pagination pagination.Pagination) (conversationIDs []string, err error)
- func (c *ConversationMgo) Take(ctx context.Context, userID, conversationID string) (conversation *model.Conversation, err error)
- func (c *ConversationMgo) Update(ctx context.Context, conversation *model.Conversation) (err error)
- func (c *ConversationMgo) UpdateByMap(ctx context.Context, userIDs []string, conversationID string, ...) (int64, error)
- type FriendMgo
- func (f *FriendMgo) Create(ctx context.Context, friends []*model.Friend) error
- func (f *FriendMgo) Delete(ctx context.Context, ownerUserID string, friendUserIDs []string) error
- func (f *FriendMgo) FindFriendUserID(ctx context.Context, friendUserID string) ([]string, error)
- func (f *FriendMgo) FindFriendUserIDs(ctx context.Context, ownerUserID string) ([]string, error)
- func (f *FriendMgo) FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) ([]*model.Friend, error)
- func (f *FriendMgo) FindInWhoseFriends(ctx context.Context, friendUserID string, pagination pagination.Pagination) (int64, []*model.Friend, error)
- func (f *FriendMgo) FindIncrVersion(ctx context.Context, ownerUserID string, version uint, limit int) (*model.VersionLog, error)
- func (f *FriendMgo) FindOwnerFriendUserIds(ctx context.Context, ownerUserID string, limit int) ([]string, error)
- func (f *FriendMgo) FindOwnerFriends(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (int64, []*model.Friend, error)
- func (f *FriendMgo) FindReversalFriends(ctx context.Context, friendUserID string, ownerUserIDs []string) ([]*model.Friend, error)
- func (f *FriendMgo) FindUserState(ctx context.Context, userID1, userID2 string) ([]*model.Friend, error)
- func (f *FriendMgo) IncrVersion(ctx context.Context, ownerUserID string, friendUserIDs []string, state int32) error
- func (f *FriendMgo) IsUpdateIsPinned(data map[string]any) bool
- func (f *FriendMgo) Take(ctx context.Context, ownerUserID, friendUserID string) (*model.Friend, error)
- func (f *FriendMgo) UpdateByMap(ctx context.Context, ownerUserID string, friendUserID string, ...) error
- func (f *FriendMgo) UpdateFriends(ctx context.Context, ownerUserID string, friendUserIDs []string, ...) error
- func (f *FriendMgo) UpdateRemark(ctx context.Context, ownerUserID, friendUserID, remark string) error
- type FriendRequestMgo
- func (f *FriendRequestMgo) Create(ctx context.Context, friendRequests []*model.FriendRequest) error
- func (f *FriendRequestMgo) Delete(ctx context.Context, fromUserID, toUserID string) (err error)
- func (f *FriendRequestMgo) Find(ctx context.Context, fromUserID, toUserID string) (friendRequest *model.FriendRequest, err error)
- func (f *FriendRequestMgo) FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*model.FriendRequest, err error)
- func (f *FriendRequestMgo) FindFromUserID(ctx context.Context, fromUserID string, pagination pagination.Pagination) (total int64, friendRequests []*model.FriendRequest, err error)
- func (f *FriendRequestMgo) FindToUserID(ctx context.Context, toUserID string, pagination pagination.Pagination) (total int64, friendRequests []*model.FriendRequest, err error)
- func (f *FriendRequestMgo) Take(ctx context.Context, fromUserID, toUserID string) (friendRequest *model.FriendRequest, err error)
- func (f *FriendRequestMgo) Update(ctx context.Context, friendRequest *model.FriendRequest) (err error)
- func (f *FriendRequestMgo) UpdateByMap(ctx context.Context, formUserID, toUserID string, args map[string]any) (err error)
- type GroupMemberMgo
- func (g *GroupMemberMgo) BatchFindMemberIncrVersion(ctx context.Context, groupIDs []string, versions []uint, limits []int) ([]*model.VersionLog, error)
- func (g *GroupMemberMgo) Create(ctx context.Context, groupMembers []*model.GroupMember) (err error)
- func (g *GroupMemberMgo) Delete(ctx context.Context, groupID string, userIDs []string) (err error)
- func (g *GroupMemberMgo) Find(ctx context.Context, groupID string, userIDs []string) ([]*model.GroupMember, error)
- func (g *GroupMemberMgo) FindInGroup(ctx context.Context, userID string, groupIDs []string) ([]*model.GroupMember, error)
- func (g *GroupMemberMgo) FindJoinIncrVersion(ctx context.Context, userID string, version uint, limit int) (*model.VersionLog, error)
- func (g *GroupMemberMgo) FindMemberIncrVersion(ctx context.Context, groupID string, version uint, limit int) (*model.VersionLog, error)
- func (g *GroupMemberMgo) FindMemberUserID(ctx context.Context, groupID string) (userIDs []string, err error)
- func (g *GroupMemberMgo) FindRoleLevelUserIDs(ctx context.Context, groupID string, roleLevel int32) ([]string, error)
- func (g *GroupMemberMgo) FindUserJoinedGroupID(ctx context.Context, userID string) (groupIDs []string, err error)
- func (g *GroupMemberMgo) FindUserManagedGroupID(ctx context.Context, userID string) (groupIDs []string, err error)
- func (g *GroupMemberMgo) IsUpdateRoleLevel(data map[string]any) bool
- func (g *GroupMemberMgo) JoinGroupIncrVersion(ctx context.Context, userID string, groupIDs []string, state int32) error
- func (g *GroupMemberMgo) MemberGroupIncrVersion(ctx context.Context, groupID string, userIDs []string, state int32) error
- func (g *GroupMemberMgo) SearchMember(ctx context.Context, keyword string, groupID string, ...) (int64, []*model.GroupMember, error)
- func (g *GroupMemberMgo) Take(ctx context.Context, groupID string, userID string) (groupMember *model.GroupMember, err error)
- func (g *GroupMemberMgo) TakeGroupMemberNum(ctx context.Context, groupID string) (count int64, err error)
- func (g *GroupMemberMgo) TakeOwner(ctx context.Context, groupID string) (groupMember *model.GroupMember, err error)
- func (g *GroupMemberMgo) Update(ctx context.Context, groupID string, userID string, data map[string]any) (err error)
- func (g *GroupMemberMgo) UpdateRoleLevel(ctx context.Context, groupID string, userID string, roleLevel int32) error
- func (g *GroupMemberMgo) UpdateUserRoleLevels(ctx context.Context, groupID string, firstUserID string, ...) error
- type GroupMgo
- func (g *GroupMgo) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error)
- func (g *GroupMgo) CountTotal(ctx context.Context, before *time.Time) (count int64, err error)
- func (g *GroupMgo) Create(ctx context.Context, groups []*model.Group) (err error)
- func (g *GroupMgo) Find(ctx context.Context, groupIDs []string) (groups []*model.Group, err error)
- func (g *GroupMgo) FindJoinSortGroupID(ctx context.Context, groupIDs []string) ([]string, error)
- func (g *GroupMgo) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*model.Group, err error)
- func (g *GroupMgo) SearchJoin(ctx context.Context, groupIDs []string, keyword string, ...) (int64, []*model.Group, error)
- func (g *GroupMgo) Take(ctx context.Context, groupID string) (group *model.Group, err error)
- func (g *GroupMgo) UpdateMap(ctx context.Context, groupID string, args map[string]any) (err error)
- func (g *GroupMgo) UpdateStatus(ctx context.Context, groupID string, status int32) (err error)
- type GroupRequestMgo
- func (g *GroupRequestMgo) Create(ctx context.Context, groupRequests []*model.GroupRequest) (err error)
- func (g *GroupRequestMgo) Delete(ctx context.Context, groupID string, userID string) (err error)
- func (g *GroupRequestMgo) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) ([]*model.GroupRequest, error)
- func (g *GroupRequestMgo) Page(ctx context.Context, userID string, pagination pagination.Pagination) (total int64, groups []*model.GroupRequest, err error)
- func (g *GroupRequestMgo) PageGroup(ctx context.Context, groupIDs []string, pagination pagination.Pagination) (total int64, groups []*model.GroupRequest, err error)
- func (g *GroupRequestMgo) Take(ctx context.Context, groupID string, userID string) (groupRequest *model.GroupRequest, err error)
- func (g *GroupRequestMgo) UpdateHandler(ctx context.Context, groupID string, userID string, handledMsg string, ...) (err error)
- type LogMgo
- func (l *LogMgo) Create(ctx context.Context, log []*model.Log) error
- func (l *LogMgo) Delete(ctx context.Context, logID []string, userID string) error
- func (l *LogMgo) Get(ctx context.Context, logIDs []string, userID string) ([]*model.Log, error)
- func (l *LogMgo) Search(ctx context.Context, keyword string, start time.Time, end time.Time, ...) (int64, []*model.Log, error)
- type MsgMgo
- func (m *MsgMgo) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string)
- func (m *MsgMgo) Create(ctx context.Context, msg *model.MsgDocModel) error
- func (m *MsgMgo) DeleteDoc(ctx context.Context, docID string) error
- func (m *MsgMgo) DeleteDocs(ctx context.Context, docIDs []string) error
- func (m *MsgMgo) DeleteMsgByIndex(ctx context.Context, docID string, index []int) error
- func (m *MsgMgo) DeleteMsgsInOneDocByIndex(ctx context.Context, docID string, indexes []int) error
- func (m *MsgMgo) FindOneByDocID(ctx context.Context, docID string) (*model.MsgDocModel, error)
- func (m *MsgMgo) GetBeforeMsg(ctx context.Context, ts int64, docIDs []string, limit int) ([]*model.MsgDocModel, error)
- func (m *MsgMgo) GetDocIDs(ctx context.Context) ([]string, error)
- func (m *MsgMgo) GetMsgBySeqIndexIn1Doc(ctx context.Context, userID, docID string, seqs []int64) ([]*model.MsgInfoModel, error)
- func (m *MsgMgo) GetMsgDocModelByIndex(ctx context.Context, conversationID string, index, sort int64) (*model.MsgDocModel, error)
- func (m *MsgMgo) GetNewestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
- func (m *MsgMgo) GetOldestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
- func (m *MsgMgo) IsExistDocID(ctx context.Context, docID string) (bool, error)
- func (m *MsgMgo) MarkSingleChatMsgsAsRead(ctx context.Context, userID string, docID string, indexes []int64) error
- func (m *MsgMgo) PushMsgsToDoc(ctx context.Context, docID string, msgsToMongo []model.MsgInfoModel) error
- func (m *MsgMgo) PushUnique(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
- func (m *MsgMgo) RangeGroupSendCount(ctx context.Context, start time.Time, end time.Time, ase bool, ...) (msgCount int64, userCount int64, groups []*model.GroupCount, ...)
- func (m *MsgMgo) RangeUserSendCount(ctx context.Context, start time.Time, end time.Time, group bool, ase bool, ...) (msgCount int64, userCount int64, users []*model.UserCount, ...)
- func (m *MsgMgo) SearchMessage(ctx context.Context, req *msg.SearchMessageReq) (int64, []*model.MsgInfoModel, error)
- func (m *MsgMgo) UpdateMsg(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
- func (m *MsgMgo) UpdateMsgContent(ctx context.Context, docID string, index int64, msg []byte) error
- type S3Mongo
- func (o *S3Mongo) Delete(ctx context.Context, engine string, name string) error
- func (o *S3Mongo) FindByExpires(ctx context.Context, duration time.Time, pagination pagination.Pagination) (total int64, objects []*model.Object, err error)
- func (o *S3Mongo) FindNotDelByS3(ctx context.Context, key string, duration time.Time) (int64, error)
- func (o *S3Mongo) SetObject(ctx context.Context, obj *model.Object) error
- func (o *S3Mongo) Take(ctx context.Context, engine string, name string) (*model.Object, error)
- type UserMgo
- func (u *UserMgo) AddUserCommand(ctx context.Context, userID string, Type int32, UUID string, value string, ...) error
- func (u *UserMgo) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error)
- func (u *UserMgo) CountTotal(ctx context.Context, before *time.Time) (count int64, err error)
- func (u *UserMgo) Create(ctx context.Context, users []*model.User) error
- func (u *UserMgo) DeleteUserCommand(ctx context.Context, userID string, Type int32, UUID string) error
- func (u *UserMgo) Exist(ctx context.Context, userID string) (exist bool, err error)
- func (u *UserMgo) Find(ctx context.Context, userIDs []string) (users []*model.User, err error)
- func (u *UserMgo) GetAllUserCommand(ctx context.Context, userID string) ([]*user.AllCommandInfoResp, error)
- func (u *UserMgo) GetAllUserID(ctx context.Context, pagination pagination.Pagination) (int64, []string, error)
- func (u *UserMgo) GetUserCommand(ctx context.Context, userID string, Type int32) ([]*user.CommandInfoResp, error)
- func (u *UserMgo) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error)
- func (u *UserMgo) Page(ctx context.Context, pagination pagination.Pagination) (count int64, users []*model.User, err error)
- func (u *UserMgo) PageFindUser(ctx context.Context, level1 int64, level2 int64, ...) (count int64, users []*model.User, err error)
- func (u *UserMgo) PageFindUserWithKeyword(ctx context.Context, level1 int64, level2 int64, userID string, ...) (count int64, users []*model.User, err error)
- func (u *UserMgo) SortQuery(ctx context.Context, userIDName map[string]string, asc bool) ([]*model.User, error)
- func (u *UserMgo) Take(ctx context.Context, userID string) (user *model.User, err error)
- func (u *UserMgo) TakeByNickname(ctx context.Context, nickname string) (user []*model.User, err error)
- func (u *UserMgo) TakeNotification(ctx context.Context, level int64) (user []*model.User, err error)
- func (u *UserMgo) UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error)
- func (u *UserMgo) UpdateUserCommand(ctx context.Context, userID string, Type int32, UUID string, ...) error
- type VersionLogMgo
- func (l *VersionLogMgo) BatchFindChangeLog(ctx context.Context, dIds []string, versions []uint, limits []int) (vLogs []*model.VersionLog, err error)
- func (l *VersionLogMgo) Delete(ctx context.Context, dId string) error
- func (l *VersionLogMgo) DeleteAfterUnchangedLog(ctx context.Context, deadline time.Time) error
- func (l *VersionLogMgo) FindChangeLog(ctx context.Context, dId string, version uint, limit int) (*model.VersionLog, error)
- func (l *VersionLogMgo) IncrVersion(ctx context.Context, dId string, eIds []string, state int32) error
- func (l *VersionLogMgo) IncrVersionResult(ctx context.Context, dId string, eIds []string, state int32) (*model.VersionLog, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
func NewFriendMongo ¶
NewFriendMongo creates a new instance of FriendMgo with the provided MongoDB database.
func NewFriendRequestMongo ¶
func NewFriendRequestMongo(db *mongo.Database) (database.FriendRequest, error)
func NewGroupMember ¶
func NewGroupMember(db *mongo.Database) (database.GroupMember, error)
func NewGroupRequestMgo ¶
func NewGroupRequestMgo(db *mongo.Database) (database.GroupRequest, error)
func NewS3Mongo ¶
func NewS3Mongo(db *mongo.Database) (database.ObjectInfo, error)
func NewSeqConversationMongo ¶
func NewSeqConversationMongo(db *mongo.Database) (database.SeqConversation, error)
func NewVersionLog ¶
func NewVersionLog(coll *mongo.Collection) (database.VersionLog, error)
Types ¶
type BlackMgo ¶
type BlackMgo struct {
// contains filtered or unexported fields
}
func (*BlackMgo) FindBlackUserIDs ¶
func (*BlackMgo) FindOwnerBlackInfos ¶
func (*BlackMgo) FindOwnerBlacks ¶
func (b *BlackMgo) FindOwnerBlacks(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (total int64, blacks []*model.Black, err error)
type ConversationMgo ¶
type ConversationMgo struct {
// contains filtered or unexported fields
}
func NewConversationMongo ¶
func NewConversationMongo(db *mongo.Database) (*ConversationMgo, error)
func (*ConversationMgo) Create ¶
func (c *ConversationMgo) Create(ctx context.Context, conversations []*model.Conversation) (err error)
func (*ConversationMgo) Find ¶
func (c *ConversationMgo) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*model.Conversation, err error)
func (*ConversationMgo) FindConversationID ¶
func (*ConversationMgo) FindConversationUserVersion ¶
func (c *ConversationMgo) FindConversationUserVersion(ctx context.Context, userID string, version uint, limit int) (*model.VersionLog, error)
func (*ConversationMgo) FindRecvMsgUserIDs ¶
func (*ConversationMgo) FindUserID ¶
func (*ConversationMgo) FindUserIDAllConversationID ¶
func (*ConversationMgo) FindUserIDAllConversations ¶
func (c *ConversationMgo) FindUserIDAllConversations(ctx context.Context, userID string) (conversations []*model.Conversation, err error)
func (*ConversationMgo) FindUserIDAllNotNotifyConversationID ¶ added in v3.8.1
func (*ConversationMgo) FindUserIDAllPinnedConversationID ¶ added in v3.8.1
func (*ConversationMgo) GetAllConversationIDs ¶
func (c *ConversationMgo) GetAllConversationIDs(ctx context.Context) ([]string, error)
func (*ConversationMgo) GetAllConversationIDsNumber ¶
func (c *ConversationMgo) GetAllConversationIDsNumber(ctx context.Context) (int64, error)
func (*ConversationMgo) GetConversationIDsNeedDestruct ¶
func (c *ConversationMgo) GetConversationIDsNeedDestruct(ctx context.Context) ([]*model.Conversation, error)
func (*ConversationMgo) GetConversationNotReceiveMessageUserIDs ¶
func (*ConversationMgo) GetConversationsByConversationID ¶
func (c *ConversationMgo) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*model.Conversation, error)
func (*ConversationMgo) GetUserRecvMsgOpt ¶
func (*ConversationMgo) PageConversationIDs ¶
func (c *ConversationMgo) PageConversationIDs(ctx context.Context, pagination pagination.Pagination) (conversationIDs []string, err error)
func (*ConversationMgo) Take ¶
func (c *ConversationMgo) Take(ctx context.Context, userID, conversationID string) (conversation *model.Conversation, err error)
func (*ConversationMgo) Update ¶
func (c *ConversationMgo) Update(ctx context.Context, conversation *model.Conversation) (err error)
type FriendMgo ¶
type FriendMgo struct {
// contains filtered or unexported fields
}
FriendMgo implements Friend using MongoDB as the storage backend.
func (*FriendMgo) FindFriendUserID ¶
func (*FriendMgo) FindFriendUserIDs ¶
FindFriendUserIDs retrieves a list of friend user IDs for a given owner.
func (*FriendMgo) FindFriends ¶
func (f *FriendMgo) FindFriends(ctx context.Context, ownerUserID string, friendUserIDs []string) ([]*model.Friend, error)
FindFriends retrieves a list of friends for a given owner. Missing friends do not cause an error.
func (*FriendMgo) FindInWhoseFriends ¶
func (f *FriendMgo) FindInWhoseFriends(ctx context.Context, friendUserID string, pagination pagination.Pagination) (int64, []*model.Friend, error)
FindInWhoseFriends finds users who have added the specified user as a friend, with pagination.
func (*FriendMgo) FindIncrVersion ¶
func (*FriendMgo) FindOwnerFriendUserIds ¶
func (*FriendMgo) FindOwnerFriends ¶
func (f *FriendMgo) FindOwnerFriends(ctx context.Context, ownerUserID string, pagination pagination.Pagination) (int64, []*model.Friend, error)
FindOwnerFriends retrieves a paginated list of friends for a given owner.
func (*FriendMgo) FindReversalFriends ¶
func (f *FriendMgo) FindReversalFriends(ctx context.Context, friendUserID string, ownerUserIDs []string) ([]*model.Friend, error)
FindReversalFriends finds users who have added the specified user as a friend.
func (*FriendMgo) FindUserState ¶
func (f *FriendMgo) FindUserState(ctx context.Context, userID1, userID2 string) ([]*model.Friend, error)
FindUserState finds the friendship status between two users.
func (*FriendMgo) IncrVersion ¶
func (*FriendMgo) Take ¶
func (f *FriendMgo) Take(ctx context.Context, ownerUserID, friendUserID string) (*model.Friend, error)
Take retrieves a single friend document. Returns an error if not found.
func (*FriendMgo) UpdateByMap ¶
func (f *FriendMgo) UpdateByMap(ctx context.Context, ownerUserID string, friendUserID string, args map[string]any) error
UpdateByMap updates specific fields of a friend document using a map.
func (*FriendMgo) UpdateFriends ¶
type FriendRequestMgo ¶
type FriendRequestMgo struct {
// contains filtered or unexported fields
}
func (*FriendRequestMgo) Create ¶
func (f *FriendRequestMgo) Create(ctx context.Context, friendRequests []*model.FriendRequest) error
func (*FriendRequestMgo) Delete ¶
func (f *FriendRequestMgo) Delete(ctx context.Context, fromUserID, toUserID string) (err error)
func (*FriendRequestMgo) Find ¶
func (f *FriendRequestMgo) Find(ctx context.Context, fromUserID, toUserID string) (friendRequest *model.FriendRequest, err error)
func (*FriendRequestMgo) FindBothFriendRequests ¶
func (f *FriendRequestMgo) FindBothFriendRequests(ctx context.Context, fromUserID, toUserID string) (friends []*model.FriendRequest, err error)
func (*FriendRequestMgo) FindFromUserID ¶
func (f *FriendRequestMgo) FindFromUserID(ctx context.Context, fromUserID string, pagination pagination.Pagination) (total int64, friendRequests []*model.FriendRequest, err error)
func (*FriendRequestMgo) FindToUserID ¶
func (f *FriendRequestMgo) FindToUserID(ctx context.Context, toUserID string, pagination pagination.Pagination) (total int64, friendRequests []*model.FriendRequest, err error)
func (*FriendRequestMgo) Take ¶
func (f *FriendRequestMgo) Take(ctx context.Context, fromUserID, toUserID string) (friendRequest *model.FriendRequest, err error)
func (*FriendRequestMgo) Update ¶
func (f *FriendRequestMgo) Update(ctx context.Context, friendRequest *model.FriendRequest) (err error)
func (*FriendRequestMgo) UpdateByMap ¶
type GroupMemberMgo ¶
type GroupMemberMgo struct {
// contains filtered or unexported fields
}
func (*GroupMemberMgo) BatchFindMemberIncrVersion ¶
func (g *GroupMemberMgo) BatchFindMemberIncrVersion(ctx context.Context, groupIDs []string, versions []uint, limits []int) ([]*model.VersionLog, error)
func (*GroupMemberMgo) Create ¶
func (g *GroupMemberMgo) Create(ctx context.Context, groupMembers []*model.GroupMember) (err error)
func (*GroupMemberMgo) Find ¶
func (g *GroupMemberMgo) Find(ctx context.Context, groupID string, userIDs []string) ([]*model.GroupMember, error)
func (*GroupMemberMgo) FindInGroup ¶
func (g *GroupMemberMgo) FindInGroup(ctx context.Context, userID string, groupIDs []string) ([]*model.GroupMember, error)
func (*GroupMemberMgo) FindJoinIncrVersion ¶
func (g *GroupMemberMgo) FindJoinIncrVersion(ctx context.Context, userID string, version uint, limit int) (*model.VersionLog, error)
func (*GroupMemberMgo) FindMemberIncrVersion ¶
func (g *GroupMemberMgo) FindMemberIncrVersion(ctx context.Context, groupID string, version uint, limit int) (*model.VersionLog, error)
func (*GroupMemberMgo) FindMemberUserID ¶
func (*GroupMemberMgo) FindRoleLevelUserIDs ¶
func (*GroupMemberMgo) FindUserJoinedGroupID ¶
func (*GroupMemberMgo) FindUserManagedGroupID ¶
func (*GroupMemberMgo) IsUpdateRoleLevel ¶
func (g *GroupMemberMgo) IsUpdateRoleLevel(data map[string]any) bool
func (*GroupMemberMgo) JoinGroupIncrVersion ¶
func (*GroupMemberMgo) MemberGroupIncrVersion ¶
func (*GroupMemberMgo) SearchMember ¶
func (g *GroupMemberMgo) SearchMember(ctx context.Context, keyword string, groupID string, pagination pagination.Pagination) (int64, []*model.GroupMember, error)
func (*GroupMemberMgo) Take ¶
func (g *GroupMemberMgo) Take(ctx context.Context, groupID string, userID string) (groupMember *model.GroupMember, err error)
func (*GroupMemberMgo) TakeGroupMemberNum ¶
func (*GroupMemberMgo) TakeOwner ¶
func (g *GroupMemberMgo) TakeOwner(ctx context.Context, groupID string) (groupMember *model.GroupMember, err error)
func (*GroupMemberMgo) UpdateRoleLevel ¶
type GroupMgo ¶
type GroupMgo struct {
// contains filtered or unexported fields
}
func (*GroupMgo) CountRangeEverydayTotal ¶
func (*GroupMgo) CountTotal ¶
func (*GroupMgo) FindJoinSortGroupID ¶
func (*GroupMgo) Search ¶
func (g *GroupMgo) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*model.Group, err error)
func (*GroupMgo) SearchJoin ¶
type GroupRequestMgo ¶
type GroupRequestMgo struct {
// contains filtered or unexported fields
}
func (*GroupRequestMgo) Create ¶
func (g *GroupRequestMgo) Create(ctx context.Context, groupRequests []*model.GroupRequest) (err error)
func (*GroupRequestMgo) FindGroupRequests ¶
func (g *GroupRequestMgo) FindGroupRequests(ctx context.Context, groupID string, userIDs []string) ([]*model.GroupRequest, error)
func (*GroupRequestMgo) Page ¶
func (g *GroupRequestMgo) Page(ctx context.Context, userID string, pagination pagination.Pagination) (total int64, groups []*model.GroupRequest, err error)
func (*GroupRequestMgo) PageGroup ¶
func (g *GroupRequestMgo) PageGroup(ctx context.Context, groupIDs []string, pagination pagination.Pagination) (total int64, groups []*model.GroupRequest, err error)
func (*GroupRequestMgo) Take ¶
func (g *GroupRequestMgo) Take(ctx context.Context, groupID string, userID string) (groupRequest *model.GroupRequest, err error)
func (*GroupRequestMgo) UpdateHandler ¶
type LogMgo ¶
type LogMgo struct {
// contains filtered or unexported fields
}
type MsgMgo ¶
type MsgMgo struct {
// contains filtered or unexported fields
}
func (*MsgMgo) ConvertMsgsDocLen ¶
func (*MsgMgo) DeleteMsgByIndex ¶
func (*MsgMgo) DeleteMsgsInOneDocByIndex ¶
func (*MsgMgo) FindOneByDocID ¶
func (*MsgMgo) GetBeforeMsg ¶
func (*MsgMgo) GetMsgBySeqIndexIn1Doc ¶
func (*MsgMgo) GetMsgDocModelByIndex ¶
func (*MsgMgo) GetNewestMsg ¶
func (*MsgMgo) GetOldestMsg ¶
func (*MsgMgo) IsExistDocID ¶
func (*MsgMgo) MarkSingleChatMsgsAsRead ¶
func (*MsgMgo) PushMsgsToDoc ¶
func (*MsgMgo) PushUnique ¶
func (*MsgMgo) RangeGroupSendCount ¶
func (*MsgMgo) RangeUserSendCount ¶
func (*MsgMgo) SearchMessage ¶
func (m *MsgMgo) SearchMessage(ctx context.Context, req *msg.SearchMessageReq) (int64, []*model.MsgInfoModel, error)
type S3Mongo ¶
type S3Mongo struct {
// contains filtered or unexported fields
}
func (*S3Mongo) FindByExpires ¶
func (*S3Mongo) FindNotDelByS3 ¶
type UserMgo ¶
type UserMgo struct {
// contains filtered or unexported fields
}
func (*UserMgo) AddUserCommand ¶
func (*UserMgo) CountRangeEverydayTotal ¶
func (*UserMgo) CountTotal ¶
func (*UserMgo) DeleteUserCommand ¶
func (*UserMgo) GetAllUserCommand ¶
func (*UserMgo) GetAllUserID ¶
func (u *UserMgo) GetAllUserID(ctx context.Context, pagination pagination.Pagination) (int64, []string, error)
func (*UserMgo) GetUserCommand ¶
func (*UserMgo) GetUserGlobalRecvMsgOpt ¶
func (*UserMgo) Page ¶
func (u *UserMgo) Page(ctx context.Context, pagination pagination.Pagination) (count int64, users []*model.User, err error)
func (*UserMgo) PageFindUser ¶
func (*UserMgo) PageFindUserWithKeyword ¶
func (*UserMgo) TakeByNickname ¶
func (*UserMgo) TakeNotification ¶
func (*UserMgo) UpdateByMap ¶
type VersionLogMgo ¶
type VersionLogMgo struct {
// contains filtered or unexported fields
}
func (*VersionLogMgo) BatchFindChangeLog ¶
func (l *VersionLogMgo) BatchFindChangeLog(ctx context.Context, dIds []string, versions []uint, limits []int) (vLogs []*model.VersionLog, err error)
func (*VersionLogMgo) Delete ¶
func (l *VersionLogMgo) Delete(ctx context.Context, dId string) error
func (*VersionLogMgo) DeleteAfterUnchangedLog ¶
func (*VersionLogMgo) FindChangeLog ¶
func (l *VersionLogMgo) FindChangeLog(ctx context.Context, dId string, version uint, limit int) (*model.VersionLog, error)
func (*VersionLogMgo) IncrVersion ¶
func (*VersionLogMgo) IncrVersionResult ¶
func (l *VersionLogMgo) IncrVersionResult(ctx context.Context, dId string, eIds []string, state int32) (*model.VersionLog, error)