Documentation ¶
Index ¶
- Constants
- func GetDefaultOpt() rockscache.Options
- func NewMetaCacheRedis(rcClient *rockscache.Client, keys ...string) metaCache
- func NewRedis() (redis.UniversalClient, error)
- func RemoveRepeatedElementsInList[T Comparable](slc []T) []T
- type BlackCache
- type BlackCacheRedis
- type Comparable
- type ConversationCache
- type ConversationRedisCache
- func (c *ConversationRedisCache) DelConversationByConversationID(conversationIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelConversationIDs(userIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelConversationNotReceiveMessageUserIDs(conversationIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDs(groupID string) ConversationCache
- func (c *ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDsHash(groupID string) ConversationCache
- func (c *ConversationRedisCache) DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelUserConversationIDsHash(ownerUserIDs ...string) ConversationCache
- func (c *ConversationRedisCache) DelUserRecvMsgOpt(ownerUserID, conversationID string) ConversationCache
- func (c *ConversationRedisCache) DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache
- func (c *ConversationRedisCache) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*relationtb.ConversationModel, error)
- func (c *ConversationRedisCache) GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error)
- func (c *ConversationRedisCache) GetConversations(ctx context.Context, ownerUserID string, conversationIDs []string) ([]*relationtb.ConversationModel, error)
- func (c *ConversationRedisCache) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*relationtb.ConversationModel, error)
- func (c *ConversationRedisCache) GetSuperGroupRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) (userIDs []string, err error)
- func (c *ConversationRedisCache) GetSuperGroupRecvMsgNotNotifyUserIDsHash(ctx context.Context, groupID string) (hash uint64, err error)
- func (c *ConversationRedisCache) GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.ConversationModel, error)
- func (c *ConversationRedisCache) GetUserAllHasReadSeqs(ctx context.Context, ownerUserID string) (map[string]int64, error)
- func (c *ConversationRedisCache) GetUserConversationIDs(ctx context.Context, ownerUserID string) ([]string, error)
- func (c *ConversationRedisCache) GetUserConversationIDsHash(ctx context.Context, ownerUserID string) (hash uint64, err error)
- func (c *ConversationRedisCache) GetUserRecvMsgOpt(ctx context.Context, ownerUserID, conversationID string) (opt int, err error)
- func (c *ConversationRedisCache) NewCache() ConversationCache
- type FriendCache
- type FriendCacheRedis
- func (f *FriendCacheRedis) DelFriend(ownerUserID, friendUserID string) FriendCache
- func (f *FriendCacheRedis) DelFriendIDs(ownerUserID ...string) FriendCache
- func (f *FriendCacheRedis) DelTwoWayFriendIDs(ctx context.Context, ownerUserID string) FriendCache
- func (f *FriendCacheRedis) GetFriend(ctx context.Context, ownerUserID, friendUserID string) (friend *relationtb.FriendModel, err error)
- func (f *FriendCacheRedis) GetFriendIDs(ctx context.Context, ownerUserID string) (friendIDs []string, err error)
- func (f *FriendCacheRedis) GetTwoWayFriendIDs(ctx context.Context, ownerUserID string) (twoWayFriendIDs []string, err error)
- func (c *FriendCacheRedis) NewCache() FriendCache
- type GroupCache
- type GroupCacheRedis
- func (g *GroupCacheRedis) DelGroupMemberIDs(groupID string) GroupCache
- func (g *GroupCacheRedis) DelGroupMembersHash(groupID string) GroupCache
- func (g *GroupCacheRedis) DelGroupMembersInfo(groupID string, userIDs ...string) GroupCache
- func (g *GroupCacheRedis) DelGroupsInfo(groupIDs ...string) GroupCache
- func (g *GroupCacheRedis) DelGroupsMemberNum(groupID ...string) GroupCache
- func (g *GroupCacheRedis) DelJoinedGroupID(userIDs ...string) GroupCache
- func (g *GroupCacheRedis) DelJoinedSuperGroupIDs(userIDs ...string) GroupCache
- func (g *GroupCacheRedis) DelSuperGroupMemberIDs(groupIDs ...string) GroupCache
- func (g *GroupCacheRedis) GetAllGroupMemberInfo(ctx context.Context, groupID string) ([]*relationtb.GroupMemberModel, error)
- func (g *GroupCacheRedis) GetAllGroupMembersInfo(ctx context.Context, groupID string) (groupMembers []*relationtb.GroupMemberModel, err error)
- func (g *GroupCacheRedis) GetGroupIndex(group *relationtb.GroupModel, keys []string) (int, error)
- func (g *GroupCacheRedis) GetGroupInfo(ctx context.Context, groupID string) (group *relationtb.GroupModel, err error)
- func (g *GroupCacheRedis) GetGroupMemberHashMap(ctx context.Context, groupIDs []string) (map[string]*relationtb.GroupSimpleUserID, error)
- func (g *GroupCacheRedis) GetGroupMemberIDs(ctx context.Context, groupID string) (groupMemberIDs []string, err error)
- func (g *GroupCacheRedis) GetGroupMemberIndex(groupMember *relationtb.GroupMemberModel, keys []string) (int, error)
- func (g *GroupCacheRedis) GetGroupMemberInfo(ctx context.Context, groupID, userID string) (groupMember *relationtb.GroupMemberModel, err error)
- func (g *GroupCacheRedis) GetGroupMemberNum(ctx context.Context, groupID string) (memberNum int64, err error)
- func (g *GroupCacheRedis) GetGroupMembersHash(ctx context.Context, groupID string) (hashCode uint64, err error)
- func (g *GroupCacheRedis) GetGroupMembersInfo(ctx context.Context, groupID string, userIDs []string) ([]*relationtb.GroupMemberModel, error)
- func (g *GroupCacheRedis) GetGroupMembersPage(ctx context.Context, groupID string, userIDs []string, ...) (total uint32, groupMembers []*relationtb.GroupMemberModel, err error)
- func (g *GroupCacheRedis) GetGroupsInfo(ctx context.Context, groupIDs []string) (groups []*relationtb.GroupModel, err error)
- func (g *GroupCacheRedis) GetGroupsMemberIDs(ctx context.Context, groupIDs []string) (map[string][]string, error)
- func (g *GroupCacheRedis) GetJoinedGroupIDs(ctx context.Context, userID string) (joinedGroupIDs []string, err error)
- func (g *GroupCacheRedis) GetJoinedSuperGroupIDs(ctx context.Context, userID string) (joinedSuperGroupIDs []string, err error)
- func (g *GroupCacheRedis) GetSuperGroupMemberIDs(ctx context.Context, groupIDs ...string) (models []*unrelationtb.SuperGroupModel, err error)
- func (g *GroupCacheRedis) NewCache() GroupCache
- type MsgModel
- type SeqCache
- type UserCache
- type UserCacheRedis
- func (u *UserCacheRedis) DelUsersGlobalRecvMsgOpt(userIDs ...string) UserCache
- func (u *UserCacheRedis) DelUsersInfo(userIDs ...string) UserCache
- func (u *UserCacheRedis) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error)
- func (u *UserCacheRedis) GetUserInfo(ctx context.Context, userID string) (userInfo *relationtb.UserModel, err error)
- func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
- func (u *UserCacheRedis) GetUsersInfo(ctx context.Context, userIDs []string) ([]*relationtb.UserModel, error)
- func (u *UserCacheRedis) NewCache() UserCache
- func (u *UserCacheRedis) SetUserStatus(ctx context.Context, userID string, status, platformID int32) error
Constants ¶
View Source
const (
SuperGroupMemberIDsKey = "SUPER_GROUP_MEMBER_IDS:"
)
View Source
const (
TwoWayFriendsIDsKey = "COMMON_FRIENDS_IDS:"
)
Variables ¶
This section is empty.
Functions ¶
func GetDefaultOpt ¶
func GetDefaultOpt() rockscache.Options
func NewMetaCacheRedis ¶
func NewMetaCacheRedis(rcClient *rockscache.Client, keys ...string) metaCache
func NewRedis ¶
func NewRedis() (redis.UniversalClient, error)
NewRedis Initialize redis connection.
func RemoveRepeatedElementsInList ¶ added in v3.4.0
func RemoveRepeatedElementsInList[T Comparable](slc []T) []T
Types ¶
type BlackCache ¶
type BlackCache interface { NewCache() BlackCache GetBlackIDs(ctx context.Context, userID string) (blackIDs []string, err error) // del user's blackIDs msgCache, exec when a user's black list changed DelBlackIDs(ctx context.Context, userID string) BlackCache // contains filtered or unexported methods }
args fn will exec when no data in msgCache.
func NewBlackCacheRedis ¶
func NewBlackCacheRedis( rdb redis.UniversalClient, blackDB relationtb.BlackModelInterface, options rockscache.Options, ) BlackCache
type BlackCacheRedis ¶
type BlackCacheRedis struct {
// contains filtered or unexported fields
}
func (*BlackCacheRedis) DelBlackIDs ¶
func (b *BlackCacheRedis) DelBlackIDs(ctx context.Context, userID string) BlackCache
func (*BlackCacheRedis) GetBlackIDs ¶
func (*BlackCacheRedis) NewCache ¶
func (b *BlackCacheRedis) NewCache() BlackCache
type ConversationCache ¶
type ConversationCache interface { NewCache() ConversationCache // get user's conversationIDs from msgCache GetUserConversationIDs(ctx context.Context, ownerUserID string) ([]string, error) DelConversationIDs(userIDs ...string) ConversationCache GetUserConversationIDsHash(ctx context.Context, ownerUserID string) (hash uint64, err error) DelUserConversationIDsHash(ownerUserIDs ...string) ConversationCache // get one conversation from msgCache GetConversation(ctx context.Context, ownerUserID, conversationID string) (*relationtb.ConversationModel, error) DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache // get one conversation from msgCache GetConversations(ctx context.Context, ownerUserID string, conversationIDs []string) ([]*relationtb.ConversationModel, error) // get one user's all conversations from msgCache GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.ConversationModel, error) // get user conversation recv msg from msgCache GetUserRecvMsgOpt(ctx context.Context, ownerUserID, conversationID string) (opt int, err error) DelUserRecvMsgOpt(ownerUserID, conversationID string) ConversationCache // get one super group recv msg but do not notification userID list GetSuperGroupRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) (userIDs []string, err error) DelSuperGroupRecvMsgNotNotifyUserIDs(groupID string) ConversationCache // get one super group recv msg but do not notification userID list hash GetSuperGroupRecvMsgNotNotifyUserIDsHash(ctx context.Context, groupID string) (hash uint64, err error) DelSuperGroupRecvMsgNotNotifyUserIDsHash(groupID string) ConversationCache GetUserAllHasReadSeqs(ctx context.Context, ownerUserID string) (map[string]int64, error) DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string) ConversationCache GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*relationtb.ConversationModel, error) DelConversationByConversationID(conversationIDs ...string) ConversationCache GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error) DelConversationNotReceiveMessageUserIDs(conversationIDs ...string) ConversationCache // contains filtered or unexported methods }
arg fn will exec when no data in msgCache.
func NewConversationRedis ¶
func NewConversationRedis( rdb redis.UniversalClient, opts rockscache.Options, db relationtb.ConversationModelInterface, ) ConversationCache
func NewNewConversationRedis ¶
func NewNewConversationRedis( rdb redis.UniversalClient, conversationDB *relation.ConversationGorm, options rockscache.Options, ) ConversationCache
type ConversationRedisCache ¶
type ConversationRedisCache struct {
// contains filtered or unexported fields
}
func (*ConversationRedisCache) DelConversationByConversationID ¶
func (c *ConversationRedisCache) DelConversationByConversationID(conversationIDs ...string) ConversationCache
func (*ConversationRedisCache) DelConversationIDs ¶
func (c *ConversationRedisCache) DelConversationIDs(userIDs ...string) ConversationCache
func (*ConversationRedisCache) DelConversationNotReceiveMessageUserIDs ¶ added in v3.3.2
func (c *ConversationRedisCache) DelConversationNotReceiveMessageUserIDs(conversationIDs ...string) ConversationCache
func (*ConversationRedisCache) DelConversations ¶
func (c *ConversationRedisCache) DelConversations(ownerUserID string, conversationIDs ...string) ConversationCache
func (*ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDs ¶
func (c *ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDs(groupID string) ConversationCache
func (*ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDsHash ¶
func (c *ConversationRedisCache) DelSuperGroupRecvMsgNotNotifyUserIDsHash(groupID string) ConversationCache
func (*ConversationRedisCache) DelUserAllHasReadSeqs ¶
func (c *ConversationRedisCache) DelUserAllHasReadSeqs(ownerUserID string, conversationIDs ...string, ) ConversationCache
func (*ConversationRedisCache) DelUserConversationIDsHash ¶
func (c *ConversationRedisCache) DelUserConversationIDsHash(ownerUserIDs ...string) ConversationCache
func (*ConversationRedisCache) DelUserRecvMsgOpt ¶
func (c *ConversationRedisCache) DelUserRecvMsgOpt(ownerUserID, conversationID string) ConversationCache
func (*ConversationRedisCache) DelUsersConversation ¶
func (c *ConversationRedisCache) DelUsersConversation(conversationID string, ownerUserIDs ...string) ConversationCache
func (*ConversationRedisCache) GetConversation ¶
func (c *ConversationRedisCache) GetConversation( ctx context.Context, ownerUserID, conversationID string, ) (*relationtb.ConversationModel, error)
func (*ConversationRedisCache) GetConversationNotReceiveMessageUserIDs ¶ added in v3.3.2
func (*ConversationRedisCache) GetConversations ¶
func (c *ConversationRedisCache) GetConversations( ctx context.Context, ownerUserID string, conversationIDs []string, ) ([]*relationtb.ConversationModel, error)
func (*ConversationRedisCache) GetConversationsByConversationID ¶
func (c *ConversationRedisCache) GetConversationsByConversationID( ctx context.Context, conversationIDs []string, ) ([]*relationtb.ConversationModel, error)
func (*ConversationRedisCache) GetSuperGroupRecvMsgNotNotifyUserIDs ¶
func (*ConversationRedisCache) GetSuperGroupRecvMsgNotNotifyUserIDsHash ¶
func (*ConversationRedisCache) GetUserAllConversations ¶
func (c *ConversationRedisCache) GetUserAllConversations( ctx context.Context, ownerUserID string, ) ([]*relationtb.ConversationModel, error)
func (*ConversationRedisCache) GetUserAllHasReadSeqs ¶
func (*ConversationRedisCache) GetUserConversationIDs ¶
func (*ConversationRedisCache) GetUserConversationIDsHash ¶
func (*ConversationRedisCache) GetUserRecvMsgOpt ¶
func (*ConversationRedisCache) NewCache ¶
func (c *ConversationRedisCache) NewCache() ConversationCache
type FriendCache ¶
type FriendCache interface { NewCache() FriendCache GetFriendIDs(ctx context.Context, ownerUserID string) (friendIDs []string, err error) // call when friendID List changed DelFriendIDs(ownerUserID ...string) FriendCache // get single friendInfo from msgCache GetFriend(ctx context.Context, ownerUserID, friendUserID string) (friend *relationtb.FriendModel, err error) // del friend when friend info changed DelFriend(ownerUserID, friendUserID string) FriendCache // contains filtered or unexported methods }
args fn will exec when no data in msgCache.
func NewFriendCacheRedis ¶
func NewFriendCacheRedis( rdb redis.UniversalClient, friendDB relationtb.FriendModelInterface, options rockscache.Options, ) FriendCache
type FriendCacheRedis ¶
type FriendCacheRedis struct {
// contains filtered or unexported fields
}
func (*FriendCacheRedis) DelFriend ¶
func (f *FriendCacheRedis) DelFriend(ownerUserID, friendUserID string) FriendCache
func (*FriendCacheRedis) DelFriendIDs ¶
func (f *FriendCacheRedis) DelFriendIDs(ownerUserID ...string) FriendCache
func (*FriendCacheRedis) DelTwoWayFriendIDs ¶
func (f *FriendCacheRedis) DelTwoWayFriendIDs(ctx context.Context, ownerUserID string) FriendCache
func (*FriendCacheRedis) GetFriend ¶
func (f *FriendCacheRedis) GetFriend( ctx context.Context, ownerUserID, friendUserID string, ) (friend *relationtb.FriendModel, err error)
func (*FriendCacheRedis) GetFriendIDs ¶
func (*FriendCacheRedis) GetTwoWayFriendIDs ¶
func (f *FriendCacheRedis) GetTwoWayFriendIDs( ctx context.Context, ownerUserID string, ) (twoWayFriendIDs []string, err error)
todo.
func (*FriendCacheRedis) NewCache ¶
func (c *FriendCacheRedis) NewCache() FriendCache
type GroupCache ¶
type GroupCache interface { NewCache() GroupCache GetGroupsInfo(ctx context.Context, groupIDs []string) (groups []*relationtb.GroupModel, err error) GetGroupInfo(ctx context.Context, groupID string) (group *relationtb.GroupModel, err error) DelGroupsInfo(groupIDs ...string) GroupCache GetJoinedSuperGroupIDs(ctx context.Context, userID string) (joinedSuperGroupIDs []string, err error) DelJoinedSuperGroupIDs(userIDs ...string) GroupCache GetSuperGroupMemberIDs(ctx context.Context, groupIDs ...string) (models []*unrelationtb.SuperGroupModel, err error) DelSuperGroupMemberIDs(groupIDs ...string) GroupCache GetGroupMembersHash(ctx context.Context, groupID string) (hashCode uint64, err error) GetGroupMemberHashMap(ctx context.Context, groupIDs []string) (map[string]*relationtb.GroupSimpleUserID, error) DelGroupMembersHash(groupID string) GroupCache GetGroupMemberIDs(ctx context.Context, groupID string) (groupMemberIDs []string, err error) GetGroupsMemberIDs(ctx context.Context, groupIDs []string) (groupMemberIDs map[string][]string, err error) DelGroupMemberIDs(groupID string) GroupCache GetJoinedGroupIDs(ctx context.Context, userID string) (joinedGroupIDs []string, err error) DelJoinedGroupID(userID ...string) GroupCache GetGroupMemberInfo( ctx context.Context, groupID, userID string, ) (groupMember *relationtb.GroupMemberModel, err error) GetGroupMembersInfo( ctx context.Context, groupID string, userID []string, ) (groupMembers []*relationtb.GroupMemberModel, err error) GetAllGroupMembersInfo(ctx context.Context, groupID string) (groupMembers []*relationtb.GroupMemberModel, err error) GetGroupMembersPage( ctx context.Context, groupID string, userID []string, showNumber, pageNumber int32, ) (total uint32, groupMembers []*relationtb.GroupMemberModel, err error) DelGroupMembersInfo(groupID string, userID ...string) GroupCache GetGroupMemberNum(ctx context.Context, groupID string) (memberNum int64, err error) DelGroupsMemberNum(groupID ...string) GroupCache // contains filtered or unexported methods }
func NewGroupCacheRedis ¶
func NewGroupCacheRedis( rdb redis.UniversalClient, groupDB relationtb.GroupModelInterface, groupMemberDB relationtb.GroupMemberModelInterface, groupRequestDB relationtb.GroupRequestModelInterface, mongoClient unrelationtb.SuperGroupModelInterface, hashCode func(ctx context.Context, groupID string) (uint64, error), opts rockscache.Options, ) GroupCache
type GroupCacheRedis ¶
type GroupCacheRedis struct {
// contains filtered or unexported fields
}
func (*GroupCacheRedis) DelGroupMemberIDs ¶
func (g *GroupCacheRedis) DelGroupMemberIDs(groupID string) GroupCache
func (*GroupCacheRedis) DelGroupMembersHash ¶
func (g *GroupCacheRedis) DelGroupMembersHash(groupID string) GroupCache
func (*GroupCacheRedis) DelGroupMembersInfo ¶
func (g *GroupCacheRedis) DelGroupMembersInfo(groupID string, userIDs ...string) GroupCache
func (*GroupCacheRedis) DelGroupsInfo ¶
func (g *GroupCacheRedis) DelGroupsInfo(groupIDs ...string) GroupCache
func (*GroupCacheRedis) DelGroupsMemberNum ¶
func (g *GroupCacheRedis) DelGroupsMemberNum(groupID ...string) GroupCache
func (*GroupCacheRedis) DelJoinedGroupID ¶
func (g *GroupCacheRedis) DelJoinedGroupID(userIDs ...string) GroupCache
func (*GroupCacheRedis) DelJoinedSuperGroupIDs ¶
func (g *GroupCacheRedis) DelJoinedSuperGroupIDs(userIDs ...string) GroupCache
userJoinSuperGroup.
func (*GroupCacheRedis) DelSuperGroupMemberIDs ¶
func (g *GroupCacheRedis) DelSuperGroupMemberIDs(groupIDs ...string) GroupCache
func (*GroupCacheRedis) GetAllGroupMemberInfo ¶
func (g *GroupCacheRedis) GetAllGroupMemberInfo( ctx context.Context, groupID string, ) ([]*relationtb.GroupMemberModel, error)
func (*GroupCacheRedis) GetAllGroupMembersInfo ¶
func (g *GroupCacheRedis) GetAllGroupMembersInfo( ctx context.Context, groupID string, ) (groupMembers []*relationtb.GroupMemberModel, err error)
func (*GroupCacheRedis) GetGroupIndex ¶
func (g *GroupCacheRedis) GetGroupIndex(group *relationtb.GroupModel, keys []string) (int, error)
func (*GroupCacheRedis) GetGroupInfo ¶
func (g *GroupCacheRedis) GetGroupInfo(ctx context.Context, groupID string) (group *relationtb.GroupModel, err error)
func (*GroupCacheRedis) GetGroupMemberHashMap ¶
func (g *GroupCacheRedis) GetGroupMemberHashMap( ctx context.Context, groupIDs []string, ) (map[string]*relationtb.GroupSimpleUserID, error)
func (*GroupCacheRedis) GetGroupMemberIDs ¶
func (g *GroupCacheRedis) GetGroupMemberIDs(ctx context.Context, groupID string) (groupMemberIDs []string, err error)
groupMemberIDs.
func (*GroupCacheRedis) GetGroupMemberIndex ¶
func (g *GroupCacheRedis) GetGroupMemberIndex(groupMember *relationtb.GroupMemberModel, keys []string) (int, error)
func (*GroupCacheRedis) GetGroupMemberInfo ¶
func (g *GroupCacheRedis) GetGroupMemberInfo( ctx context.Context, groupID, userID string, ) (groupMember *relationtb.GroupMemberModel, err error)
func (*GroupCacheRedis) GetGroupMemberNum ¶
func (*GroupCacheRedis) GetGroupMembersHash ¶
func (g *GroupCacheRedis) GetGroupMembersHash(ctx context.Context, groupID string) (hashCode uint64, err error)
groupMembersHash.
func (*GroupCacheRedis) GetGroupMembersInfo ¶
func (g *GroupCacheRedis) GetGroupMembersInfo( ctx context.Context, groupID string, userIDs []string, ) ([]*relationtb.GroupMemberModel, error)
func (*GroupCacheRedis) GetGroupMembersPage ¶
func (g *GroupCacheRedis) GetGroupMembersPage( ctx context.Context, groupID string, userIDs []string, showNumber, pageNumber int32, ) (total uint32, groupMembers []*relationtb.GroupMemberModel, err error)
func (*GroupCacheRedis) GetGroupsInfo ¶
func (g *GroupCacheRedis) GetGroupsInfo( ctx context.Context, groupIDs []string, ) (groups []*relationtb.GroupModel, err error)
/ groupInfo.
func (*GroupCacheRedis) GetGroupsMemberIDs ¶
func (*GroupCacheRedis) GetJoinedGroupIDs ¶
func (*GroupCacheRedis) GetJoinedSuperGroupIDs ¶
func (*GroupCacheRedis) GetSuperGroupMemberIDs ¶
func (g *GroupCacheRedis) GetSuperGroupMemberIDs( ctx context.Context, groupIDs ...string, ) (models []*unrelationtb.SuperGroupModel, err error)
func (*GroupCacheRedis) NewCache ¶
func (g *GroupCacheRedis) NewCache() GroupCache
type MsgModel ¶
type MsgModel interface { SeqCache AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error GetTokensWithoutError(ctx context.Context, userID string, platformID int) (map[string]int, error) SetTokenMapByUidPid(ctx context.Context, userID string, platformID int, m map[string]int) error DeleteTokenByUidPid(ctx context.Context, userID string, platformID int, fields []string) error GetMessagesBySeq( ctx context.Context, conversationID string, seqs []int64, ) (seqMsg []*sdkws.MsgData, failedSeqList []int64, err error) SetMessageToCache(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) (int, error) UserDeleteMsgs(ctx context.Context, conversationID string, seqs []int64, userID string) error DelUserDeleteMsgsList(ctx context.Context, conversationID string, seqs []int64) DeleteMessages(ctx context.Context, conversationID string, seqs []int64) error GetUserDelList(ctx context.Context, userID, conversationID string) (seqs []int64, err error) CleanUpOneConversationAllMsg(ctx context.Context, conversationID string) error DelMsgFromCache(ctx context.Context, userID string, seqList []int64) error SetSendMsgStatus(ctx context.Context, id string, status int32) error GetSendMsgStatus(ctx context.Context, id string) (int32, error) JudgeMessageReactionExist(ctx context.Context, clientMsgID string, sessionType int32) (bool, error) GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error) DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error SetMessageReactionExpire( ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration, ) (bool, error) GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error) SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error LockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error // contains filtered or unexported methods }
func NewMsgCacheModel ¶
func NewMsgCacheModel(client redis.UniversalClient) MsgModel
type SeqCache ¶
type SeqCache interface { SetMaxSeq(ctx context.Context, conversationID string, maxSeq int64) error GetMaxSeqs(ctx context.Context, conversationIDs []string) (map[string]int64, error) GetMaxSeq(ctx context.Context, conversationID string) (int64, error) SetMinSeq(ctx context.Context, conversationID string, minSeq int64) error SetMinSeqs(ctx context.Context, seqs map[string]int64) error GetMinSeqs(ctx context.Context, conversationIDs []string) (map[string]int64, error) GetMinSeq(ctx context.Context, conversationID string) (int64, error) GetConversationUserMinSeq(ctx context.Context, conversationID string, userID string) (int64, error) GetConversationUserMinSeqs(ctx context.Context, conversationID string, userIDs []string) (map[string]int64, error) SetConversationUserMinSeq(ctx context.Context, conversationID string, userID string, minSeq int64) error // seqs map: key userID value minSeq SetConversationUserMinSeqs(ctx context.Context, conversationID string, seqs map[string]int64) (err error) // seqs map: key conversationID value minSeq SetUserConversationsMinSeqs(ctx context.Context, userID string, seqs map[string]int64) error // has read seq SetHasReadSeq(ctx context.Context, userID string, conversationID string, hasReadSeq int64) error // k: user, v: seq SetHasReadSeqs(ctx context.Context, conversationID string, hasReadSeqs map[string]int64) error // k: conversation, v :seq UserSetHasReadSeqs(ctx context.Context, userID string, hasReadSeqs map[string]int64) error GetHasReadSeqs(ctx context.Context, userID string, conversationIDs []string) (map[string]int64, error) GetHasReadSeq(ctx context.Context, userID string, conversationID string) (int64, error) }
type UserCache ¶
type UserCache interface { NewCache() UserCache GetUserInfo(ctx context.Context, userID string) (userInfo *relationtb.UserModel, err error) GetUsersInfo(ctx context.Context, userIDs []string) ([]*relationtb.UserModel, error) DelUsersInfo(userIDs ...string) UserCache GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) DelUsersGlobalRecvMsgOpt(userIDs ...string) UserCache GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) SetUserStatus(ctx context.Context, userID string, status, platformID int32) error // contains filtered or unexported methods }
func NewUserCacheRedis ¶
func NewUserCacheRedis( rdb redis.UniversalClient, userDB relationtb.UserModelInterface, options rockscache.Options, ) UserCache
type UserCacheRedis ¶
type UserCacheRedis struct {
// contains filtered or unexported fields
}
func (*UserCacheRedis) DelUsersGlobalRecvMsgOpt ¶
func (u *UserCacheRedis) DelUsersGlobalRecvMsgOpt(userIDs ...string) UserCache
func (*UserCacheRedis) DelUsersInfo ¶
func (u *UserCacheRedis) DelUsersInfo(userIDs ...string) UserCache
func (*UserCacheRedis) GetUserGlobalRecvMsgOpt ¶
func (*UserCacheRedis) GetUserInfo ¶
func (u *UserCacheRedis) GetUserInfo(ctx context.Context, userID string) (userInfo *relationtb.UserModel, err error)
func (*UserCacheRedis) GetUserStatus ¶
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
GetUserStatus get user status.
func (*UserCacheRedis) GetUsersInfo ¶
func (u *UserCacheRedis) GetUsersInfo(ctx context.Context, userIDs []string) ([]*relationtb.UserModel, error)
func (*UserCacheRedis) NewCache ¶
func (u *UserCacheRedis) NewCache() UserCache
func (*UserCacheRedis) SetUserStatus ¶
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, userID string, status, platformID int32) error
SetUserStatus Set the user status and save it in redis.
Click to show internal directories.
Click to hide internal directories.