rpcclient

package
v3.3.3-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

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
}

type Conversation

type Conversation struct {
	Client pbconversation.ConversationClient
	// contains filtered or unexported fields
}

type ConversationRpcClient

type ConversationRpcClient Conversation

func (*ConversationRpcClient) GetConversation

func (c *ConversationRpcClient) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*pbconversation.Conversation, error)

func (*ConversationRpcClient) GetConversationIDs

func (c *ConversationRpcClient) GetConversationIDs(ctx context.Context, ownerUserID string) ([]string, error)

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) GetSingleConversationRecvMsgOpt

func (c *ConversationRpcClient) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error)

func (*ConversationRpcClient) GroupChatFirstCreateConversation

func (c *ConversationRpcClient) GroupChatFirstCreateConversation(ctx context.Context, groupID string, userIDs []string) error

func (*ConversationRpcClient) SetConversationMaxSeq

func (c *ConversationRpcClient) SetConversationMaxSeq(ctx context.Context, ownerUserIDs []string, conversationID string, maxSeq int64) error

func (*ConversationRpcClient) SetConversations

func (c *ConversationRpcClient) SetConversations(ctx context.Context, userIDs []string, conversation *pbconversation.ConversationReq) error

func (*ConversationRpcClient) SingleChatFirstCreateConversation

func (c *ConversationRpcClient) SingleChatFirstCreateConversation(ctx context.Context, recvID, sendID,
	conversationID string, conversationType int32) error

type Friend

type Friend struct {
	Client friend.FriendClient
	// contains filtered or unexported fields
}

type FriendRpcClient

type FriendRpcClient Friend

func (*FriendRpcClient) GetFriendIDs

func (f *FriendRpcClient) GetFriendIDs(ctx context.Context, ownerUserID string) (friendIDs []string, err error)

func (*FriendRpcClient) GetFriendsInfo

func (f *FriendRpcClient) GetFriendsInfo(
	ctx context.Context,
	ownerUserID, friendUserID string,
) (resp *sdkws.FriendInfo, err error)

func (*FriendRpcClient) IsBlocked

func (b *FriendRpcClient) IsBlocked(ctx context.Context, possibleBlackUserID, userID string) (bool, error)

func (*FriendRpcClient) IsFriend

func (f *FriendRpcClient) IsFriend(ctx context.Context, possibleFriendUserID, userID string) (bool, error)

possibleFriendUserID是否在userID的好友中.

type Group

type Group struct {
	Client group.GroupClient
	// contains filtered or unexported fields
}

type GroupRpcClient

type GroupRpcClient Group

func (*GroupRpcClient) DismissGroup

func (g *GroupRpcClient) DismissGroup(ctx context.Context, groupID string) error

func (*GroupRpcClient) GetGroupInfo

func (g *GroupRpcClient) GetGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error)

func (*GroupRpcClient) GetGroupInfoCache

func (g *GroupRpcClient) GetGroupInfoCache(ctx context.Context, groupID string) (*sdkws.GroupInfo, error)

func (*GroupRpcClient) GetGroupInfoMap

func (g *GroupRpcClient) GetGroupInfoMap(
	ctx context.Context,
	groupIDs []string,
	complete bool,
) (map[string]*sdkws.GroupInfo, error)

func (*GroupRpcClient) GetGroupInfos

func (g *GroupRpcClient) GetGroupInfos(
	ctx context.Context,
	groupIDs []string,
	complete bool,
) ([]*sdkws.GroupInfo, error)

func (*GroupRpcClient) GetGroupMemberCache

func (g *GroupRpcClient) GetGroupMemberCache(
	ctx context.Context,
	groupID string,
	groupMemberID string,
) (*sdkws.GroupMemberFullInfo, error)

func (*GroupRpcClient) GetGroupMemberIDs

func (g *GroupRpcClient) GetGroupMemberIDs(ctx context.Context, groupID string) ([]string, error)

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

type Message struct {
	Client msg.MsgClient
	// contains filtered or unexported fields
}

type MessageRpcClient

type MessageRpcClient Message

func (*MessageRpcClient) GetConversationMaxSeq

func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversationID string) (int64, error)

func (*MessageRpcClient) GetMaxSeq

func (*MessageRpcClient) PullMessageBySeqList

func (*MessageRpcClient) SendMsg

func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)

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(opts ...NotificationSenderOptions) *NotificationSender

func (*NotificationSender) Notification

func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...NotificationOptions) error

func (*NotificationSender) NotificationWithSesstionType

func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, sendID, recvID string, contentType, sesstionType int32, m proto.Message, opts ...NotificationOptions) (err error)

type NotificationSenderOptions

type NotificationSenderOptions func(*NotificationSender)

func WithLocalSendMsg

func WithLocalSendMsg(sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)) 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 (*PushRpcClient) DelUserPushToken

func (p *PushRpcClient) DelUserPushToken(
	ctx context.Context,
	req *push.DelUserPushTokenReq,
) (*push.DelUserPushTokenResp, error)

type Third

type Third struct {
	Client third.ThirdClient

	MinioClient *minio.Client
	// contains filtered or unexported fields
}

type User

type User struct {
	Client user.UserClient
	Discov discoveryregistry.SvcDiscoveryRegistry
	// contains filtered or unexported fields
}

User represents a structure holding connection details for the User RPC client.

func NewUser

NewUser initializes and returns a User instance based on the provided service discovery registry.

type UserRpcClient

type UserRpcClient User

UserRpcClient represents the structure for a User RPC client.

func NewUserRpcClient

func NewUserRpcClient(client discoveryregistry.SvcDiscoveryRegistry) 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) GetAllUserIDs

func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumber int32) ([]string, error)

GetAllUserIDs retrieves all user IDs with pagination options.

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,
	complete bool,
) (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,
	complete bool,
) ([]*sdkws.PublicUserInfo, error)

GetPublicUserInfos retrieves public information for multiple users based on their user IDs.

func (*UserRpcClient) GetUserGlobalMsgRecvOpt

func (u *UserRpcClient) GetUserGlobalMsgRecvOpt(ctx context.Context, userID string) (int32, error)

GetUserGlobalMsgRecvOpt retrieves the global message receive option for a user based on the provided user ID.

func (*UserRpcClient) GetUserInfo

func (u *UserRpcClient) GetUserInfo(ctx context.Context, userID string) (*sdkws.UserInfo, error)

GetUserInfo retrieves information for a single user based on the provided user ID.

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) 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL