Documentation ¶
Index ¶
- type Auth
- func (a *Auth) InvalidateToken(ctx context.Context, preservedToken, userID string, platformID int) (*auth.InvalidateTokenResp, error)
- func (a *Auth) KickTokens(ctx context.Context, tokens []string) (*auth.KickTokensResp, error)
- func (a *Auth) ParseToken(ctx context.Context, token string) (*auth.ParseTokenResp, error)
- type Conversation
- type ConversationRpcClient
- func (c *ConversationRpcClient) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*pbconversation.Conversation, error)
- func (c *ConversationRpcClient) GetConversationIDs(ctx context.Context, ownerUserID string) ([]string, error)
- func (c *ConversationRpcClient) GetConversationNotReceiveMessageUserIDs(ctx context.Context, conversationID string) ([]string, error)
- func (c *ConversationRpcClient) GetConversationOfflinePushUserIDs(ctx context.Context, conversationID string, userIDs []string) ([]string, error)
- func (c *ConversationRpcClient) GetConversations(ctx context.Context, ownerUserID string, conversationIDs []string) ([]*pbconversation.Conversation, error)
- func (c *ConversationRpcClient) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*pbconversation.Conversation, error)
- func (c *ConversationRpcClient) GetConversationsNeedDestructMsgs(ctx context.Context) ([]*pbconversation.Conversation, error)
- func (c *ConversationRpcClient) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error)
- func (c *ConversationRpcClient) GroupChatFirstCreateConversation(ctx context.Context, groupID string, userIDs []string) error
- func (c *ConversationRpcClient) SetConversationMaxSeq(ctx context.Context, ownerUserIDs []string, conversationID string, ...) error
- func (c *ConversationRpcClient) SetConversationMinSeq(ctx context.Context, ownerUserIDs []string, conversationID string, ...) error
- func (c *ConversationRpcClient) SetConversations(ctx context.Context, userIDs []string, ...) error
- func (c *ConversationRpcClient) SingleChatFirstCreateConversation(ctx context.Context, recvID, sendID, conversationID string, ...) error
- func (c *ConversationRpcClient) UpdateConversation(ctx context.Context, conversation *pbconversation.UpdateConversationReq) error
- type Friend
- type FriendRpcClient
- func (f *FriendRpcClient) GetFriendIDs(ctx context.Context, ownerUserID string) (relationIDs []string, err error)
- func (f *FriendRpcClient) GetFriendsInfo(ctx context.Context, ownerUserID, relationUserID string) (resp *sdkws.FriendInfo, err error)
- func (f *FriendRpcClient) IsBlack(ctx context.Context, possibleBlackUserID, userID string) (bool, error)
- func (f *FriendRpcClient) IsFriend(ctx context.Context, possibleFriendUserID, userID string) (bool, error)
- type Group
- type GroupRpcClient
- func (g *GroupRpcClient) DismissGroup(ctx context.Context, groupID string) error
- func (g *GroupRpcClient) GetGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error)
- func (g *GroupRpcClient) GetGroupInfoCache(ctx context.Context, groupID string) (*sdkws.GroupInfo, error)
- func (g *GroupRpcClient) GetGroupInfoMap(ctx context.Context, groupIDs []string, complete bool) (map[string]*sdkws.GroupInfo, error)
- func (g *GroupRpcClient) GetGroupInfos(ctx context.Context, groupIDs []string, complete bool) ([]*sdkws.GroupInfo, error)
- func (g *GroupRpcClient) GetGroupMemberCache(ctx context.Context, groupID string, groupMemberID string) (*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) GetGroupMemberIDs(ctx context.Context, groupID string) ([]string, error)
- func (g *GroupRpcClient) GetGroupMemberInfo(ctx context.Context, groupID string, userID string) (*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) GetGroupMemberInfoMap(ctx context.Context, groupID string, userIDs []string, complete bool) (map[string]*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) GetGroupMemberInfos(ctx context.Context, groupID string, userIDs []string, complete bool) ([]*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) GetOwnerAndAdminInfos(ctx context.Context, groupID string) ([]*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) GetOwnerInfo(ctx context.Context, groupID string) (*sdkws.GroupMemberFullInfo, error)
- func (g *GroupRpcClient) NotificationUserInfoUpdate(ctx context.Context, userID string) error
- type Message
- type MessageRpcClient
- func (m *MessageRpcClient) ClearMsg(ctx context.Context, ts int64) error
- func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversationID string) (int64, error)
- func (m *MessageRpcClient) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *msg.GetConversationsHasReadAndMaxSeqReq) (*msg.GetConversationsHasReadAndMaxSeqResp, error)
- func (m *MessageRpcClient) GetHasReadSeqs(ctx context.Context, userID string, conversationIDs []string) (map[string]int64, error)
- func (m *MessageRpcClient) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error)
- func (m *MessageRpcClient) GetMaxSeqs(ctx context.Context, conversationIDs []string) (map[string]int64, error)
- func (m *MessageRpcClient) GetMsgByConversationIDs(ctx context.Context, docIDs []string, seqs map[string]int64) (map[string]*sdkws.MsgData, error)
- func (m *MessageRpcClient) GetSeqMessage(ctx context.Context, req *msg.GetSeqMessageReq) (*msg.GetSeqMessageResp, error)
- func (m *MessageRpcClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error)
- func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)
- func (m *MessageRpcClient) SetUserConversationsMinSeq(ctx context.Context, req *msg.SetUserConversationsMinSeqReq) (*msg.SetUserConversationsMinSeqResp, error)
- type NotificationOptions
- type NotificationSender
- func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, ...)
- func (s *NotificationSender) NotificationWithSessionType(ctx context.Context, sendID, recvID string, contentType, sessionType int32, ...)
- func (s *NotificationSender) SetOptionsByContentType(_ context.Context, options map[string]bool, contentType int32)
- type NotificationSenderOptions
- type Push
- type PushRpcClient
- type Third
- type User
- type UserRpcClient
- func (u *UserRpcClient) Access(ctx context.Context, ownerUserID string) error
- func (u *UserRpcClient) GetAllOnlineUsers(ctx context.Context, cursor uint64) (*user.GetAllOnlineUsersResp, error)
- func (u *UserRpcClient) GetAllUserID(ctx context.Context, pageNumber, showNumber int32) (*user.GetAllUserIDResp, error)
- func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumber int32) ([]string, error)
- func (u *UserRpcClient) GetNotificationByID(ctx context.Context, userID string) error
- func (u *UserRpcClient) GetPublicUserInfo(ctx context.Context, userID string) (*sdkws.PublicUserInfo, error)
- func (u *UserRpcClient) GetPublicUserInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.PublicUserInfo, error)
- func (u *UserRpcClient) GetPublicUserInfos(ctx context.Context, userIDs []string) ([]*sdkws.PublicUserInfo, error)
- func (u *UserRpcClient) GetUserGlobalMsgRecvOpt(ctx context.Context, userID string) (int32, error)
- func (u *UserRpcClient) GetUserInfo(ctx context.Context, userID string) (*sdkws.UserInfo, error)
- func (u *UserRpcClient) GetUserOnlinePlatform(ctx context.Context, userID string) ([]int32, error)
- func (u *UserRpcClient) GetUsersInfo(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error)
- func (u *UserRpcClient) GetUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error)
- func (u *UserRpcClient) GetUsersOnlinePlatform(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
- func (u *UserRpcClient) SetUserStatus(ctx context.Context, userID string, status int32, platformID int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { Client auth.AuthClient // contains filtered or unexported fields }
func (*Auth) InvalidateToken ¶ added in v3.7.0
func (*Auth) KickTokens ¶
func (*Auth) ParseToken ¶ added in v3.7.0
type Conversation ¶
type Conversation struct { Client pbconversation.ConversationClient // contains filtered or unexported fields }
func NewConversation ¶
func NewConversation(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) *Conversation
type ConversationRpcClient ¶
type ConversationRpcClient Conversation
func NewConversationRpcClient ¶
func NewConversationRpcClient(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) ConversationRpcClient
func (*ConversationRpcClient) GetConversation ¶
func (c *ConversationRpcClient) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*pbconversation.Conversation, error)
func (*ConversationRpcClient) GetConversationIDs ¶
func (*ConversationRpcClient) GetConversationNotReceiveMessageUserIDs ¶ added in v3.7.0
func (*ConversationRpcClient) GetConversationOfflinePushUserIDs ¶ added in v3.7.0
func (*ConversationRpcClient) GetConversations ¶
func (c *ConversationRpcClient) GetConversations(ctx context.Context, ownerUserID string, conversationIDs []string) ([]*pbconversation.Conversation, error)
func (*ConversationRpcClient) GetConversationsByConversationID ¶
func (c *ConversationRpcClient) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*pbconversation.Conversation, error)
func (*ConversationRpcClient) GetConversationsNeedDestructMsgs ¶ added in v3.8.0
func (c *ConversationRpcClient) GetConversationsNeedDestructMsgs(ctx context.Context) ([]*pbconversation.Conversation, error)
func (*ConversationRpcClient) GetSingleConversationRecvMsgOpt ¶
func (*ConversationRpcClient) GroupChatFirstCreateConversation ¶
func (*ConversationRpcClient) SetConversationMaxSeq ¶
func (*ConversationRpcClient) SetConversationMinSeq ¶ added in v3.8.1
func (*ConversationRpcClient) SetConversations ¶
func (c *ConversationRpcClient) SetConversations(ctx context.Context, userIDs []string, conversation *pbconversation.ConversationReq) error
func (*ConversationRpcClient) SingleChatFirstCreateConversation ¶
func (*ConversationRpcClient) UpdateConversation ¶ added in v3.8.0
func (c *ConversationRpcClient) UpdateConversation(ctx context.Context, conversation *pbconversation.UpdateConversationReq) error
type Friend ¶
type Friend struct { Client relation.FriendClient // contains filtered or unexported fields }
type FriendRpcClient ¶
type FriendRpcClient Friend
func NewFriendRpcClient ¶
func NewFriendRpcClient(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) FriendRpcClient
func (*FriendRpcClient) GetFriendIDs ¶
func (*FriendRpcClient) GetFriendsInfo ¶
func (f *FriendRpcClient) GetFriendsInfo( ctx context.Context, ownerUserID, relationUserID string, ) (resp *sdkws.FriendInfo, err error)
type Group ¶
type Group struct { Client group.GroupClient // contains filtered or unexported fields }
type GroupRpcClient ¶
type GroupRpcClient Group
func NewGroupRpcClient ¶
func NewGroupRpcClient(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) GroupRpcClient
func (*GroupRpcClient) DismissGroup ¶
func (g *GroupRpcClient) DismissGroup(ctx context.Context, groupID string) error
func (*GroupRpcClient) GetGroupInfo ¶
func (*GroupRpcClient) GetGroupInfoCache ¶
func (*GroupRpcClient) GetGroupInfoMap ¶
func (*GroupRpcClient) GetGroupInfos ¶
func (*GroupRpcClient) GetGroupMemberCache ¶
func (g *GroupRpcClient) GetGroupMemberCache(ctx context.Context, groupID string, groupMemberID string) (*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) GetGroupMemberIDs ¶
func (*GroupRpcClient) GetGroupMemberInfo ¶
func (g *GroupRpcClient) GetGroupMemberInfo( ctx context.Context, groupID string, userID string, ) (*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) GetGroupMemberInfoMap ¶
func (g *GroupRpcClient) GetGroupMemberInfoMap( ctx context.Context, groupID string, userIDs []string, complete bool, ) (map[string]*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) GetGroupMemberInfos ¶
func (g *GroupRpcClient) GetGroupMemberInfos( ctx context.Context, groupID string, userIDs []string, complete bool, ) ([]*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) GetOwnerAndAdminInfos ¶
func (g *GroupRpcClient) GetOwnerAndAdminInfos( ctx context.Context, groupID string, ) ([]*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) GetOwnerInfo ¶
func (g *GroupRpcClient) GetOwnerInfo(ctx context.Context, groupID string) (*sdkws.GroupMemberFullInfo, error)
func (*GroupRpcClient) NotificationUserInfoUpdate ¶
func (g *GroupRpcClient) NotificationUserInfoUpdate(ctx context.Context, userID string) error
type Message ¶
func NewMessage ¶
func NewMessage(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) *Message
type MessageRpcClient ¶
type MessageRpcClient Message
func NewMessageRpcClient ¶
func NewMessageRpcClient(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) MessageRpcClient
func (*MessageRpcClient) ClearMsg ¶ added in v3.7.1
func (m *MessageRpcClient) ClearMsg(ctx context.Context, ts int64) error
func (*MessageRpcClient) GetConversationMaxSeq ¶
func (*MessageRpcClient) GetConversationsHasReadAndMaxSeq ¶ added in v3.8.1
func (m *MessageRpcClient) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *msg.GetConversationsHasReadAndMaxSeqReq) (*msg.GetConversationsHasReadAndMaxSeqResp, error)
func (*MessageRpcClient) GetHasReadSeqs ¶ added in v3.5.0
func (*MessageRpcClient) GetMaxSeq ¶
func (m *MessageRpcClient) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error)
GetMaxSeq retrieves the maximum sequence number from the gRPC client. Errors during the gRPC call are wrapped to provide additional context.
func (*MessageRpcClient) GetMaxSeqs ¶ added in v3.5.0
func (*MessageRpcClient) GetMsgByConversationIDs ¶ added in v3.5.0
func (*MessageRpcClient) GetSeqMessage ¶ added in v3.8.1
func (m *MessageRpcClient) GetSeqMessage(ctx context.Context, req *msg.GetSeqMessageReq) (*msg.GetSeqMessageResp, error)
func (*MessageRpcClient) PullMessageBySeqList ¶
func (m *MessageRpcClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error)
PullMessageBySeqList retrieves messages by their sequence numbers using the gRPC client. It directly forwards the request to the gRPC client and returns the response along with any error encountered.
func (*MessageRpcClient) SendMsg ¶
func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)
SendMsg sends a message through the gRPC client and returns the response. It wraps any encountered error for better error handling and context understanding.
func (*MessageRpcClient) SetUserConversationsMinSeq ¶ added in v3.8.1
func (m *MessageRpcClient) SetUserConversationsMinSeq(ctx context.Context, req *msg.SetUserConversationsMinSeqReq) (*msg.SetUserConversationsMinSeqResp, error)
SetUserConversationsMinSeq set min seq
type NotificationOptions ¶
type NotificationOptions func(*notificationOpt)
func WithRpcGetUserName ¶
func WithRpcGetUserName() NotificationOptions
type NotificationSender ¶
type NotificationSender struct {
// contains filtered or unexported fields
}
func NewNotificationSender ¶
func NewNotificationSender(conf *config.Notification, opts ...NotificationSenderOptions) *NotificationSender
func (*NotificationSender) Notification ¶
func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...NotificationOptions)
func (*NotificationSender) NotificationWithSessionType ¶ added in v3.7.0
func (s *NotificationSender) NotificationWithSessionType(ctx context.Context, sendID, recvID string, contentType, sessionType int32, m proto.Message, opts ...NotificationOptions)
func (*NotificationSender) SetOptionsByContentType ¶ added in v3.5.0
type NotificationSenderOptions ¶
type NotificationSenderOptions func(*NotificationSender)
func WithLocalSendMsg ¶
func WithLocalSendMsg(sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)) NotificationSenderOptions
func WithQueue ¶ added in v3.7.0
func WithQueue(queue *memamq.MemoryQueue) NotificationSenderOptions
func WithRpcClient ¶
func WithRpcClient(msgRpcClient *MessageRpcClient) NotificationSenderOptions
func WithUserRpcClient ¶
func WithUserRpcClient(userRpcClient *UserRpcClient) NotificationSenderOptions
type Push ¶
type Push struct { Client push.PushMsgServiceClient // contains filtered or unexported fields }
type PushRpcClient ¶
type PushRpcClient Push
func NewPushRpcClient ¶
func NewPushRpcClient(discov discovery.SvcDiscoveryRegistry, rpcRegisterName string) PushRpcClient
func (*PushRpcClient) DelUserPushToken ¶
func (p *PushRpcClient) DelUserPushToken(ctx context.Context, req *push.DelUserPushTokenReq) (*push.DelUserPushTokenResp, error)
type Third ¶
type Third struct { Client third.ThirdClient GrafanaUrl string // contains filtered or unexported fields }
type User ¶
type User struct { Client user.UserClient Discov discovery.SvcDiscoveryRegistry MessageGateWayRpcName string // contains filtered or unexported fields }
User represents a structure holding connection details for the User RPC client.
type UserRpcClient ¶
type UserRpcClient User
UserRpcClient represents the structure for a User RPC client.
func NewUserRpcClient ¶
func NewUserRpcClient(client discovery.SvcDiscoveryRegistry, rpcRegisterName string, imAdminUserID []string) UserRpcClient
NewUserRpcClient initializes a UserRpcClient based on the provided service discovery registry.
func NewUserRpcClientByUser ¶
func NewUserRpcClientByUser(user *User) *UserRpcClient
NewUserRpcClientByUser initializes a UserRpcClient based on the provided User instance.
func (*UserRpcClient) Access ¶
func (u *UserRpcClient) Access(ctx context.Context, ownerUserID string) error
Access verifies the access rights for the provided user ID.
func (*UserRpcClient) GetAllOnlineUsers ¶ added in v3.8.1
func (u *UserRpcClient) GetAllOnlineUsers(ctx context.Context, cursor uint64) (*user.GetAllOnlineUsersResp, error)
func (*UserRpcClient) GetAllUserID ¶ added in v3.8.1
func (u *UserRpcClient) GetAllUserID(ctx context.Context, pageNumber, showNumber int32) (*user.GetAllUserIDResp, error)
GetAllUserID retrieves all user IDs with pagination options.
func (*UserRpcClient) GetAllUserIDs ¶
func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumber int32) ([]string, error)
GetAllUserIDs retrieves all user IDs with pagination options.
func (*UserRpcClient) GetNotificationByID ¶ added in v3.5.0
func (u *UserRpcClient) GetNotificationByID(ctx context.Context, userID string) error
func (*UserRpcClient) GetPublicUserInfo ¶
func (u *UserRpcClient) GetPublicUserInfo(ctx context.Context, userID string) (*sdkws.PublicUserInfo, error)
GetPublicUserInfo retrieves public information for a single user based on the provided user ID.
func (*UserRpcClient) GetPublicUserInfoMap ¶
func (u *UserRpcClient) GetPublicUserInfoMap( ctx context.Context, userIDs []string, ) (map[string]*sdkws.PublicUserInfo, error)
GetPublicUserInfoMap retrieves a map of public user information indexed by their user IDs.
func (*UserRpcClient) GetPublicUserInfos ¶
func (u *UserRpcClient) GetPublicUserInfos( ctx context.Context, userIDs []string, ) ([]*sdkws.PublicUserInfo, error)
GetPublicUserInfos retrieves public information for multiple users based on their user IDs.
func (*UserRpcClient) GetUserGlobalMsgRecvOpt ¶
GetUserGlobalMsgRecvOpt retrieves the global message receive option for a user based on the provided user ID.
func (*UserRpcClient) GetUserInfo ¶
GetUserInfo retrieves information for a single user based on the provided user ID.
func (*UserRpcClient) GetUserOnlinePlatform ¶ added in v3.8.0
func (*UserRpcClient) GetUsersInfo ¶
func (u *UserRpcClient) GetUsersInfo(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error)
GetUsersInfo retrieves information for multiple users based on their user IDs.
func (*UserRpcClient) GetUsersInfoMap ¶
func (u *UserRpcClient) GetUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error)
GetUsersInfoMap retrieves a map of user information indexed by their user IDs.
func (*UserRpcClient) GetUsersOnlinePlatform ¶ added in v3.8.0
func (u *UserRpcClient) GetUsersOnlinePlatform(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error)
func (*UserRpcClient) SetUserStatus ¶
func (u *UserRpcClient) SetUserStatus(ctx context.Context, userID string, status int32, platformID int) error
SetUserStatus sets the status for a user based on the provided user ID, status, and platform ID.