mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	* refactor: cmd update. * refactor: msg transfer refactor. * refactor: msg transfer refactor. * refactor: msg transfer refactor. * fix: read prometheus port when flag set to enable and prevent failure during startup. * fix: notification has counted unread counts bug fix. * fix: merge opensource code into local. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * refactor: delete message and message batch use lua. * fix: add protective measures against memory overflow.
		
			
				
	
	
		
			58 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright © 2023 OpenIM. All rights reserved.
 | 
						|
//
 | 
						|
// Licensed under the Apache License, Version 2.0 (the "License");
 | 
						|
// you may not use this file except in compliance with the License.
 | 
						|
// You may obtain a copy of the License at
 | 
						|
//
 | 
						|
//     http://www.apache.org/licenses/LICENSE-2.0
 | 
						|
//
 | 
						|
// Unless required by applicable law or agreed to in writing, software
 | 
						|
// distributed under the License is distributed on an "AS IS" BASIS,
 | 
						|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
						|
// See the License for the specific language governing permissions and
 | 
						|
// limitations under the License.
 | 
						|
 | 
						|
package cache
 | 
						|
 | 
						|
import (
 | 
						|
	"context"
 | 
						|
	relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
 | 
						|
)
 | 
						|
 | 
						|
// arg fn will exec when no data in msgCache.
 | 
						|
type ConversationCache interface {
 | 
						|
	BatchDeleter
 | 
						|
	CloneConversationCache() 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.Conversation, 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.Conversation, error)
 | 
						|
	// get one user's all conversations from msgCache
 | 
						|
	GetUserAllConversations(ctx context.Context, ownerUserID string) ([]*relationtb.Conversation, 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
 | 
						|
 | 
						|
	GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error)
 | 
						|
	DelConversationNotReceiveMessageUserIDs(conversationIDs ...string) ConversationCache
 | 
						|
}
 |