Files
open-im-server/pkg/common/cachekey/friend.go
T

25 lines
637 B
Go
Raw Normal View History

2024-01-08 15:39:39 +08:00
package cachekey
const (
2024-01-12 15:41:05 +08:00
FriendIDsKey = "FRIEND_IDS:"
TwoWayFriendsIDsKey = "COMMON_FRIENDS_IDS:"
FriendKey = "FRIEND_INFO:"
IsFriendKey = "IS_FRIEND:" // local cache key
2024-01-08 15:39:39 +08:00
)
func GetFriendIDsKey(ownerUserID string) string {
2024-01-12 15:41:05 +08:00
return FriendIDsKey + ownerUserID
2024-01-08 15:39:39 +08:00
}
func GetTwoWayFriendsIDsKey(ownerUserID string) string {
2024-01-12 15:41:05 +08:00
return TwoWayFriendsIDsKey + ownerUserID
2024-01-08 15:39:39 +08:00
}
func GetFriendKey(ownerUserID, friendUserID string) string {
2024-01-12 15:41:05 +08:00
return FriendKey + ownerUserID + "-" + friendUserID
2024-01-08 15:39:39 +08:00
}
func GetIsFriendKey(possibleFriendUserID, userID string) string {
2024-01-12 15:41:05 +08:00
return IsFriendKey + possibleFriendUserID + "-" + userID
2024-01-08 15:39:39 +08:00
}